Sram stm32f help

hello, trying to capture power traces in the sram of the stm32f303 microcontroller. following the tutorials, would i update the simpleserial_base.c file to access the sram and capture traces?

Hi,

Most of the data memory being used will be in SRAM. Do you have a particular region that you want to access?

Alex

The microcontroller is going to be frequently accessing SRAM. If you look at the lss file generated with the build, a fair percentage of the load/store instructions (ldr and str on Arm) and all of the push/pop instructions will be accessing SRAM. That being said, if you’ve done any of our tutorials, you’ve already likely measured the power of accessing SRAM, as that’s where most of the variables are stored and SRAM’s power draw is going to be much higher than something like reading/writing registers.

Okay, I understand that, thank you. I’m specifically trying to capture power traces of writing data to the SRAM using the CW308 with the STMF303 target. Is this something you can shed any light on? Or would the .lss file be the thing I look at the most here?

Apologies for the confusion I appreciate your patience.

Are you saying that the integer array I have created will be stored in SRAM? And reading/writing to it accesses SRAM?

Yeah, that’s correct. If you compile that, I think the compiler should zero the whole block of memory there. It might allocate that on the stack though, so an array that large could result in the stack (which is in SRAM) being overrun and your code crashing. Allocating that memory globally and marking it as static is safer.

okay awesome, thanks so much. one last question, would this array be shown in any of the generated files? i’ve looked through the .sym, .map, and .lss files and cannot find the array i declared but i’m not sure if it would actually show. thanks.

It should be shown in there. You may need to zero it manually via something like memset.