The generated code for a basic project for a custom board with a MCXE246 doesn't work correctly. To make it compile i needed to add
__attribute__ ((used,section(".FlashConfig"))) const struct {
unsigned int word1;
unsigned int word2;
unsigned int word3;
unsigned int word4;
} Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE};
but when debugging the code doesn't run, it keeps starting in the WDOG code executing
every line from the top of the file to the bottom even if the functions are not called.
I never reach the main()
Is it possible to provide me with a mcuexpresso project for a custom board with a mcxe246?
Thank you
Kind regards
Niels
Hi @nd_psi
Thanks for your project.
Your project is missing the start. c file.
This is a bug in our old version SDK.
But we fix it.
Please download the latest version of SDK v25.12.
BR
Harry
Hi @Harry_Zhang,
Thank you for your reply, unfortunately it still doesn't work.
When I follow the same steps, I get a compile error saying that no flashconfig is provided. I can get rid of this error by disabling the following option (which is enabled by default):
When I debug, the MCU crashes immediately and I get the error No source available for "_pvHeapStart() at 0x1fff0080" .
I have attached my project.
MCUXpresso IDE v25.6 [Build 136] [2025-06-27]
SDK_2.x_MCXE246 version 25.09.0.201911251446 (epluginsite815 2025-09-22) 3.15.0
Kind regards
Niels
Hi @nd_psi
I tested it on my end.
1. Create a new mcxe246 project.
2. You don't need to add Flash_Config , it can compile successfully
3. And i can debug it.
BR
Harry
Hi @Harry_Zhang,
Thank you for your reply,
I updated the SDK and i can now compile it without changing a setting.
But when i debug i still get an error and never reach main().
I have attached my project.
Kind regards
Niels
Hi @nd_psi
I just tested your project.
I can debug it.
So I think you can try to connect the chip with the jlink.
If you can not connect the chip : prioritize check the hardware connection
BR
Harry
Hi @nd_psi
“ I connected the J-link to the FRDM-MCXE247 board and observed the same behavior.”
In my last reply, my test board was FRDM-MCXE247 and my debuger was J-link.
So I think you can try changing a J-link.
BR
Harry
Hi @Harry_Zhang,
Thank you for your reply, unfortunately it still doesn't work.
The problem is that I can connect via J-link, but when I start debugging, the program counter jumps to a random location in memory, so you can never execute your code (you also don't end up in the main). You can connect via J-link.
I have checked the connections, and this does not offer a solution either. I connected the J-link to the FRDM-MCXE247 board and observed the same behavior.
In addition, I connected my custom board to an MCU link, and it works there, so you can run your code without any problems.
Are there any known issues with debugging using J-link?
Kind regards
Niels