This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can I read from an external SPI flash in a Keil uVision debug session?

We are using MDK 5.30 (uVision 5) with the S32K148 microcontroller and ULink2 debugger, where we are upgrading a product that has had an external parallel flash replaced with a new SPI flash part. 

The old version used the LPC2294/01 which had an external memory controller to which the flash was connected, allowing us to read data from the external flash directly in the IDE during a debug session (either in the memory/watch windows or using the 'D' command).

With the new microcontroller and flash, we have developed our own SPI driver and utility functions to read/write to the device (bare metal). However, with this architecture change, we are no longer able to read from the external flash asynchronously through the debug session anymore. This makes testing some cases somewhat difficult. 

Question: Is it possible to configure a uVision debug session to read from an external SPI flash device without changing the code on target? And if not, is it possible to use existing custom utility functions in the code to read data through a debug command?

For example: suppose we have a function with prototype readData(uint32_t pAddr, uint32_t *const pData_ptr, uint32_t pNumBytes) --> Would it be possible to invoke this function on command (from a debug command) while execution on target is stopped in order to obtain data from the external flash?

  • Hi Michael.

    You could perhaps add a variable which would trigger data read from flash and change that variable with debugger to trigger the read by MCU itself.

    You can if you have enough RAM make your code run in RAM during debugging and then change to flash once it is working.

    Best regards, Milorad