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

Reduce the size of DM0 and DM1 download packets ... and Checksum calculation

SigmaDSP & SigmaStudio alexsconway Oct 26, 2021 00:00 7 replies Original on forum ↗
Subscribe
alexsconway Question
Oct 26, 2021 00:00

I have checked the Reduce the size of DM0 and DM1 download packets by removing zero initializations option in Sigma Studio 4.6 for ADAU1452 and I have some questions:

1 :

Now I have four DM buffers in the system files output: DM0 Data1, DM0 Data2, DM1 Data1, DM1 Data2.

I think I should be sending all of them, but I can't find any documentation that even says that the two DMs will be split into 4, never mind whether I should send all or some.

Which do I need to send?

2 :

When I calculate the checksum and compare it with what the Checksum module returns:

Tthe program memory matches

Tthe DM0 only matches when I add up all the bytes in DM0data1 and DM0data2

The DM1 only matches when I calculate for DM1data1 alone.

What should I be expecfting?

Thanks

Alex

JoshuaB Reply
Oct 27, 2021 00:00

Hi Alex,

DM0 and DM1 each represent contiguous memory regions in the DSP. The checksum is calculated in 3 pieces based on the 3 memory regions of the DSP: DM0, DM1, and PM.

If the DM packets are for some reason split into multiple pieces, they will need to be combined before calculating the checksum.

Are you planning to use these DM0 and DM1 data packets to program the DSP from a microcontroller?

Usually, instead of using the discrete DM0 and DM1 data packets, we recommend using the exported C header files, usually the file names end in _IC_1.h, and following the default_download process from the bottom of that file.

We provide a microcontroller implementation guide with example code at this link:

Interfacing SigmaDSP Processors with a Microcontroller [Analog Devices Wiki]

Best regards,

Joshua

alexsconway Reply
Oct 28, 2021 00:00

I'm using the info in <project_name>.xml and observation of what Sigma Studio does. In fact, what Sigma Studio does is detailed in TxBuffer_<IC_name>.dat.

I just looked in <project_name>_<IC_name>.h and there is only DM1 and the default_download process loads it twice:

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_DSPA, PROGRAM_ADDR_DspA, PROGRAM_SIZE_DspA, Program_Data_DspA );
SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_DSPA, PARAM_ADDR_DspA, PARAM_SIZE_DspA, Param_Data_DspA );
SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_DSPA, PARAM_ADDR_DspA, PARAM_SIZE_DspA, Param_Data_DspA );
SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_DSPA, DM1_DATA_ADDR_DspA, DM1_DATA_SIZE_DspA, DM1_DATA_Data_DspA );
SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_DSPA, DM1_DATA_ADDR_DspA, DM1_DATA_SIZE_DspA, DM1_DATA_Data_DspA );
SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_DSPA, REG_KILL_CORE_DspA_ADDR, REG_KILL_CORE_DspA_BYTE, R110_KILL_CORE_DspA_Default );

It contains the whole of DM1, so how did choosing the "Reduce the size of DM0 and DM1 download packets" reduce the size?

Also, when I un-tick the option there is still only DM1. The only change in <project_name>_<IC_name>.h is that the default download process only loads it once.

alexsconway Reply
Nov 2, 2021 00:00

SigmaDspA.dspproj

Here is an example, using the attached dspproj.

(It does nothing useful except generate non-zero data for all DM0 data1, data2 and DM1 data1, data2)

It is loaded and checked with both Sigma Studio 4.6 and my own software which also verifies by reading back all the DMx data before starting the DSP running.

In both cases, PM and DM0 checksums match, but DM1 does not.

With the "Reduce the size of DM0 and DM1 download" option ticked,
I do a Compile-Link-download in Sigma Studio and the Checksum Block on the schematic reads:
Expected
PM checksum = 0xE5C18C86
DM0 checksum = 0x3A82765E
DM1 checksum = 0xFFFF9F63

I press the read button in Sigma Studio and the checksum reads back:
Actual
PM checksum = 0xE5C18C86 match
DM0 checksum = 0x3A82765E match
DM1 checksum = 0xFFFF9FF7 Not match

After exporting system files and processing the results, I calculate the checksums:
PM checksum = 0x45ACD46D
DM0 Data1 checksum = 0x3B82765E
DM0 Data2 checksum = 0xFF000000
DM1 Data1 checksum = 0xFFFF9FF7
DM1 Data2 checksum = 0xFFFFFF76
DMO Data1 + Data2 checksum = 0x3A82765E
DM1 Data1 + Data2 checksum = 0xFFFF9F63

I load the DSP using my own software with PM, DM0 data1, DM0 data2, DM1 data1, DM1 data2 and start it running,
wait for the checksum algorithm to complete and read the results (not using Sigma Studio).
the result is:
PM checksum = 0xE5C18C86 match
DMO checksum = 0x3A82767E match
DM1 checksum = 0xFFFF9FF7 Not match, but does match with DM1 Data1 checksum

I go back to Sigma Studio and untick the "Reduce the size of DM0 and DM1 download" option
I do a Compile-Link-download in Sigma Studio and the Checksum Block on the schematic reads:
Expected
PM checksum = 0x1B443252
DM0 checksum = 0x3A82767E
DM1 checksum = 0xFFFF9F62

I press the read button in Sigma Studio and the checksum reads back:
Actual
PM checksum = 0x1B443252 match
DM0 checksum = 0x3A82767E match
DM1 checksum = 0xFFFF9FF7 Not match

After exporting system files and processing the results, I calculate the checksums:
PM checksum = 0x1B443252
DMO checksum = 0x3A82767E
DM1 checksum = 0xFFFF9F62

I load the DSP using my own software with PM, DM0 data, DM1 data, and start it running,
wait for the checksum algorithm to complete and read the results (not using Sigma Studio).
the result is:
PM checksum = 0x1B443252 match
DMO checksum = 0x3AB936CE match
DM1 checksum = 0xFFFF9FF7 Not match

So, my own loading software and Sigma Studio agree that the DM1 checksum does not match.

DaveThib Reply
Nov 4, 2021 00:00

Hello Alex,

Are you clearing out all the DM1 memory before writing to DM1? I am wondering if the write is only the addresses that are being used then the checksum includes all the memory. Then there will be some random numbers in the memory after power up.

Dave T

alexsconway Reply
Nov 4, 2021 00:00

Hi Dave,

I have the "Clear the unused PM, DM0 and DM1 during initialization" option checked so I would have thought that would clear the DM1 memory correctly.

The error I'm getting doesn't indicate extra random uninitialized garbage being included in the calculation. It indicates that only some of DM1 is included in the calculation when done by the DSP.

Also, when the "Reduce the size of DM0 and DM1 download packets" option is ticked, DM0 and DM1 are split into non-contigious parts, yet the checksum calculated by the DSP is the same, regardless of this option.

Alex

JoshuaB Reply
Nov 11, 2021 00:00

Hi Alex,

Based on your findings, I wonder if the Checksum algorithm within the DSP is failing to check the DM1 upper page. We've entered a ticket with the programming team to have this checked out.

Best regards,

Joshua

DaveThib Reply
Dec 8, 2021 00:00

Hello Alex,

I heard back from the programers. It looks like it is related to the Version Control feature being enabled. They have fixed it for the next release but try to disable the version control and that might be a temporary fix.

Thanks,

Dave T