cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-H7S3L8 Debugging Code Running from XSPI NOR Flash

rbtmkr42
Associate II

I created a Boot/App/ExtMemLoader project for my NUCLEO-H7S3L8 via the STM32CubeMX for STM32CubeIDE, and ran into issues when running the application code from the external NOR Flash chip on the NUCLEO board (U18, P/N MX25UW25645GXDI00 on the schematic).  The Boot and ExtMemLoader applications run just fine.  However, the App would not run with the default config generated in STM32CubeMX.  Screenshot here:

rbtmkr42_0-1759118569172.png

After changing the FifoThresholdByte to `1`, setting the size to 256Mbit, and reducing the XSPI clock to 180MHz, I was able to get the application to run.  I probably should double-check which of these settings are necessary.  Although I can now have it execute the Application from the external FLASH, I am now running into issues when setting breakpoints and debugging the application.  The debugger stops responding entirely, and I have to kill the GDB instances in order to recover.

I wonder if something in the XSPI config is still off. Is there a way to get the datasheet for the Macronix `MX25UW25645GXDI00` memory chip? The closest part I could find is the `MX25U25645G`, but it only does x1/x2/x4 SPI.  Or perhaps, do you have a better tuned set of parameters for the device that might fix my debugging problems?

Note, too, that I have left the XSPI configuration in the Bootloader which also sets up the peripheral in memory-mapped mode before launching the application.  Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Duc
Associate III

Hi @rbtmkr42,

I have a YouTube video demonstrating the Blink LED on the NUCLEO-H7S3L8, and I’m using XSPI2_HSLV.

STM32 Project Tutorial: Blink LED on Nucleo-H7S3L8

And I also try to set the breakpoint as well, but I’m not encountering the issue you described. Are there any differences in the process you’re following?

View solution in original post

4 REPLIES 4
Mahmoud Ben Romdhane
ST Employee

Hello @rbtmkr42 

First let me thank you for posting.

I suggest that you connect the NUCLEO-H7S3L8 board with STM32CubeProgrammer and under Option bytes:

User Configuration1:

Enable XSPI1_HSLV and XSPI2 

MahmoudBenRomdhane_0-1759218575417.png

MahmoudBenRomdhane_1-1759218968540.png

MahmoudBenRomdhane_2-1759219007596.png

 

Thanks.

Mahmoud

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you, @Mahmoud Ben Romdhane .  I have already checked XSPI2_HSLV, such that the debugger can program and run the application.  However, I did not need to enable XSPI1, since the NUCLEO only uses XSPI2 (per the schematic).  Other than that, I did verify my debugger configuration against your screenshots.

The issue then manifests when I run GDB with the application.  After STM32CubeIDE finishes flashing the Application, I then issue a `monitor reset` and `continue` in the GDB console.  Then while I run the application, I attempt to set break points or pause the debugger, GDB locks up and won't respond anymore.  It doesn't always happen on the first try, but most of the time it does occur on the first try.  If not the first try then GDB will eventually hang.

I had a similar issue a couple months back, where I was running from internal flash/SRAM and I needed to disable the MPU protection.  Note, I do not have the MPU enabled in Boot/ExtMemLoader/App.

I've attached my main.c, and here is a screenshot of the debugger issue.

rbtmkr42_0-1759240972500.png

This is my config for XSPI2 on the NUCLEO board:

rbtmkr42_1-1759241365285.png

 

 

Duc
Associate III

Hi @rbtmkr42,

I have a YouTube video demonstrating the Blink LED on the NUCLEO-H7S3L8, and I’m using XSPI2_HSLV.

STM32 Project Tutorial: Blink LED on Nucleo-H7S3L8

And I also try to set the breakpoint as well, but I’m not encountering the issue you described. Are there any differences in the process you’re following?

@Duc Thank you!  This helps tremendously.  I just wasn't very familiar with using the IDE to program both the bootloader & application (I was doing it by hand previously).  I also compiled my own stdlr which I was using, but apparently didn't need to.  Also, I didn't know I could configure the debugger to load both the bootloader and application like that.  That saves me a ton of headache.  Thank you!