ΣSigmaStudio Ask AI Русский Log in

Sigmastudio 4.5 exported command inconsistency

SigmaDSP & SigmaStudio Louie.LI May 13, 2020 00:00 1 replies Original on forum ↗
Subscribe
Louie.LI Question
May 13, 2020 00:00

Dear engineer,

In developing MCU for ADAU DSPs, I found some inconsistency among codes exported from bootload button and modes button.

It mainly comes from length in function ""

//*****************************

ONE IS:

ADI_REG_TYPE MODE_0_0[40] =
{0x00, 0x0C, 0xCC, 0xCD, 0x00,
0x19, 0x99, 0x9A, 0x00,
0x26, 0x66, 0x66, 0x00,
0x33, 0x33, 0x33, 0x00,
0x40, 0x00, 0x00, 0x00,
0x4C, 0xCC, 0xCD, 0x00,
0x59, 0x99, 0x9A, 0x00,
0x66, 0x66, 0x66, 0x00,
0x68, 0xF5, 0xC3, 0x00,
0x73, 0x33, 0x33};

void MODE_0_download(){
SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_, 0x0000, 42, MODE_0_0); /* FIRFiltAlg1fircoeff_0 */}

//*****************************

THE OTHER IS:

#define REG_COREREGISTER_IC_1_ADDR 0x81C
#define REG_COREREGISTER_IC_1_BYTE 2

ADI_REG_TYPE R0_COREREGISTER_IC_1_Default[REG_COREREGISTER_IC_1_BYTE] = {
0x00, 0x18
};

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, REG_COREREGISTER_IC_1_ADDR, REG_COREREGISTER_IC_1_BYTE, R0_COREREGISTER_IC_1_Default );

//*****************************

As you may see, in the first code, length stands for 2+data_length (data is 40 bytes and length input is 42). In the second code, which is default bootload code, lengh stands for 2+data_length. (data is 2bytes and length is 2).

Hopefully it is not bugs because if array flows by 2 bytes, some unknown mistake may happen. Hope you could check those two export procedure to check where the wrong is.

Kind regards,

Louie LI

ADIApproved Reply
Jun 10, 2020 00:00

Hello Louie,

For the SIGMA_WRITE_REGISTER_BLOCK function, the length field should the length of the data. So, with your data of 40 bytes, the length should be 40 as well. Not 42.

I will report this bug to our programming team. For now, I recommend changing the code manually each time the header file is exported.

Joshua