How the DSU does work?

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I'm testing the SAMC21 and want to use the internal DSU do calc a CRC32 Checksum over a part of the internal Flash.

 

As I can see the DSU has it's Clock enabled and I can see, in the Flags, that the DSU detect the Debugger [STATUSB : DBGPRES]

 

I have try the Code like this:

 

DSU->ADDR.reg = (uint32_t)((TEMP_AREA_addr / 4) << 2);

DSU->LENGTH.reg = (uint32_t)(400 * NVMCTRL_PAGE_SIZE);

DSU->CTRL.reg = DSU_CTRL_CRC;

 

while(!DSU->STATUSA.reg & DSU_STATUSA_DONE) {} ; //wait till finish

 

uint32_t data = DSU->DATA.reg;

 

I think this should normally work, but I stay allways in the while loop, because there the Flag will not be set.

I can also see in the Atmel ICE Debugger that the Registers don't be set when I set there a value. May be the Debugger isn't able to Show the internal values...

 

I can also see that the PAC does a protection against the DSU, I don't kown why this is the case.

I never enable any protection.

 

Do you have there some idea, what I can try now?

 

Best regards

Michael

 

This topic has a solution.
Last Edited: Thu. Dec 13, 2018 - 06:46 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Problem is solved now.

 

I have made a hard override of this PAC Flag with the line:

 

PAC->WRCTRL.reg = (0x01 << 16) | 33;

 

now it works fine.

 

Thanks for your help,

have a nice day

Michael