cancel
Showing results for 
Search instead for 
Did you mean: 

How to Debug Code Executing from OctoSPI / OTFDEC in Keil MDK?

ALowe
Associate II

Hi guys,

I'm currently utilising SBSFU as an external flash secure bootloader (with all security settings turned off for debug) using the STM32H7B3's OTFDEC (On-the-fly Decryption) peripheral.

My user application boots and runs via the OFTDEC and memory-mapped OCTOSPI flash just fine via the SBSFU bootloader mapping to the region 0x90000000, however, whilst I'm able to attach my debugger to the process and see and step through lines of assembly, as soon as I load my linker file to link the process to my source code via

LOAD %L INCREMENTAL

I receive an error 57: illegal address (0x90000400) which is the correct and seemingly valid memory-mapped start address of the application. The keyword INCREMENTAL makes sure that the debugger doesn't restart the CPU when adding the linking information so the OTFDEC mapping should still be valid.

Does anyone have any suggestions or experience in debugging memory-mapped programs or in doing so with Keil MDK?

Many thanks

4 REPLIES 4
Jocelyn RICARD
ST Employee

Hello,

sorry for not answering. I need to find time get the board and reproduce setup.

I would suggest looking in STM32CubeFW for H7 the examples using external flash and check the proper debug setup.

Best regards

Jocelyn

To access (read) the memory from the debugger script (.INI) you'll actually have to manually stand-up the clocks, pins and interfaces in the script.

Probably not going to be able to write content, that generally requires that you write a Flash Algorithm and let the debugger push in the content more normally.

LOAD in this context is generally used to push data into RAM, and memory directly writable within the MCU address space at that point in the script. For external RAM you'd have to peek/poke the interfaces into existence as described earlier.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi clive,

I'm not sure we're talking about the same things here. I'm taking about attaching to a running microcontroller with all clocks prepared where I'm already able to read-out RAM, the issue comes when trying to load debug information to interpret this data.

Jocelyn RICARD
ST Employee

Hello,

Using MDK ARM 5.30 and Latest DFP 2.7.0 and using the command you provided works fine on my side.

I first downloaded the application using SBSFU.

Then I'm connecting to the target disabling any download, flash erase anything in the debug configuration.

Also disable the reset.

Then I get the SBSFU launching the application.

I attach with MDK ARM and get assembly window: symbols do not load automatically.

Then running the command you provided that is

LOAD <file> INCREMENTAL

replace <file> by the full path to UserApp.axf, I'm able to debug with symbols.

Best regards

Jocelyn