cancel
Showing results for 
Search instead for 
Did you mean: 

N657X0-Q cannot be debugged and my pitfalls are recorded

DHS729
Associate

Development tools:
windows; VScode; CubeIDE for VScode Extension; STM32CubeMX; STM32CubeProgrammer


After three days of torment, I finally managed to download it, in LRUN mode.

But debugging still doesn't work in VScode. I don't know if LRUN mode requires the same tedious CMakeLists and Launch.json configuration as XIP mode.

However, all the various debugging attempts I've tried in VScode (except once with SRAM) show:

Temporary breakpoint 1 at 0x34001612: file C:/APPS/COPRO/MCU/CUBEMX/N6_MX/Template_FSBL_LRUN/Appli/Src/main.c, line 71.
load "c:/APPS/COPRO/MCU/CUBEMX/N6_MX/Template_FSBL_LRUN/Appli/build/Template_FSBL_LRUN_Appli.elf" 
Loading section .isr_vector, size 0x34c lma 0x34000400
Loading section .text, size 0x1264 lma 0x3400074c
Loading section .init_array, size 0x4 lma 0x340019b0
Loading section .fini_array, size 0x4 lma 0x340019b4
Loading section .gnu.sgstubs, size 0x20 lma 0x340019c0
Loading section .data, size 0x20 lma 0x340019e0
Start address 0x340018f0, load size 5624
Transfer rate: 549 KB/sec, 937 bytes/write.
set *(int *)0xE000ED14=*(int *)0xE000ED14|0x10
set *(int *)0xE000EDFC=*(int *)0xE000EDFC|0xff0
set *(unsigned int *)0x44001004|=0x100000
set *(unsigned int *)0x44001004|=0x7
set *(unsigned int *)0x44001010|=0x800
set *(unsigned int *)0x4400101c|=0x40000

In the Debug Console view you can interact directly with GDB.
To display the value of an expression, type that expression which can reference
variables that are in scope. For example type '2 + 3' or the name of a variable.
Arbitrary commands can be sent to GDB by prefixing the input with a '>',
for example type '>show version' or '>help'.


Temporary breakpoint 1, main () at C:/APPS/COPRO/MCU/CUBEMX/N6_MX/Template_FSBL_LRUN/Appli/Src/main.c:71
71	  SystemCoreClockUpdate();
16
Target is not responding, retrying...
Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target
and then try again.
cube is killed by signal SIGTERMgdbserver stopped

And in the bottom right corner it shows Unable to read memory

I still don't fully understand the boot process. I need to study this more.

Also, due to the lack of internal flash, do I need to configure XSPI to use external flash every time I configure?

 

 

 

Thanks to the ST forum posts
Reference posts and PDFs:
https://community.st.com/t5/stm32-mcus/how-to-create-an-stm32n6-fsbl-load-and-run/ta-p/768206 
https://community.st.com/t5/stm32cubeide-mcus/nucleo-n657x0-q-unable-to-upload-code/m-p/876582 

https://community.st.com/t5/stm32cubeide-mcus/debugging-program-in-external-flash-xip-mode-stm32n6/m-p/794285 

https://community.st.com/t5/stm32-mcus/how-to-debug-stm32n6-using-stm32cubeide/tac-p/898644#M2012 

https://community.st.com/t5/stm32-mcus/how-to-execute-code-from-the-external-serial-nor-using-the/ta-p/771048 
https://community.st.com/t5/stm32-mcus/how-to-build-an-ai-application-from-scratch-on-the-nucleo-n657x0/ta-p/828502 

https://community.st.com/t5/stm32-mcus-embedded-software/stm32n6570-dk-lrun-project-does-not-boot/m-p/874078 

https://community.st.com/t5/stm32-mcus/how-to-build-an-ai-application-from-scratch-on-the-stm32n6570-dk/ta-p/825591 

 

 

pdf:

rm0486-stm32n647657xx-armbased-32bit-mcus-stmicroelectronics

um3234-how-to-proceed-with-boot-rom-on-stm32n6-mcus-stmicroelectronics

nucleo-n657x0-q

um3417-stm32n6-nucleo144-board-mb1940-stmicroelectronics

en.mb1940-n657x0q-c02-schematic

rm0486-stm32n6x5x7xx-armbased-32bit-mcus-stmicroelectronics

an6265-getting-started-with-stm32n6-mcus-in-stm32cubeide-stmicroelectronics

pm0273-stm32-cortexm55-mcus-programming-manual-stmicroelectronics

um3249-getting-started-with-stm32cuben6-for-stm32n6-series-stmicroelectronics

an5967-getting-started-with-hardware-development-for-stm32n6-mcus-stmicroelectronics

 

Special thanks to B.Montanari, ChatGPT, MiniMax   haha

How can one become a master?
4 REPLIES 4
faye_Lee
Associate III

Hi DHS729,

    Thank you for your share. I use N657X0-Q DK board, and met the same issue "Unable to read memory" when debuging with vscode. Have you resolved this issue?

hello,today i get some progress,it can debug a little but it break down in Appli/main.c  while loop,but at least it works like  https://community.st.com/t5/stm32-mcus/how-to-debug-the-stm32n6-using-vs-code/tac-p/902185  ,when start debug it stop in breakpoint like this passage

I modify Cmakelists and launch.json by claudecode, i found in previous version,my 
launch.json:

"serverExtLoader": [
 
it is wrong ,my xx.stdlr should be N6570-NUCLEO not DK, I correct it and then it can run a little
and other part is same as the link passage
 
I attach my Project below,you can view launch.json and Appli/Cmakrlists and FSBL/Cmakelists,you can ask AI to change your code,pay attention to standard Git version control to prevent losing your code.
And change my Path into your own Path.
 
 
 

 

How can one become a master?

I found that I can run it correctly, actually.

When I set the breakpoint in application main program and then I run the debug, it will stop in application main program loop and I can step by step debug correctly.

So its Completely fine now.  :)

How can one become a master?
DHS729
Associate

hello everyone, I record it on my own blog,and it have english version,you can view it on:https://www.729dhs.site/en/post/stm32n657-nucleo-dev-log2 

How can one become a master?
Announcement

We’re moving the ST Community to a new platform to give you a better and more reliable community experience.