2022-09-01 03:09 AM
My code runs without issue when the STM Nucleo is connected to the laptop, but if I try to run it without connection to PC, I have to press the reset button before the code will run.
I am using STM32CubeIDE and cannot find a solution relevant to that environment.
I can of course create a hardware solution to this but I would rather achieve a solution programmatically if possible.
2022-09-01 04:08 AM
Which Nucleo? What code? What is the expected behaviour, and how do you know that "code won't run"?
> if I try to run it without connection to PC
Is the problem that the code does not start as expected after powerup? How are you powering the Nucleo?
Try with simple blinky. Still problem?
JW
2022-09-02 03:46 AM
Thanks for getting back to me, and apologies for not including more information. I have created a new simple blinking LED project which behaves in the same way as my original project code, ie; requires a reset after power up to behave as expected. As such I assume it is an issue with the configuration of CubeIDE maybe?
I am using Nucleo-F746zGT6, I have attached a photo of my setup along with a zip of my simple project exported. I'm supplying <12V on Vin.
Cheers.
2022-09-02 04:27 AM
2022-09-02 04:37 AM
Did you try building with the release configuration and not debug? I'm only guessing, but in debug it maybe waits for you to press "play" on the debugger which obviously won't happen if you're not connected to STM32CubeIDE via USB
2022-09-02 06:20 AM
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_ETH_Init();
MX_USART3_UART_Init();
MX_USB_OTG_FS_PCD_Init();
This is not *simple*.
JW
2022-09-09 02:49 AM
I have tried in both debug mode and release version but behaviour remains the same.
2022-09-09 02:56 AM
Having returned to work after a few days off site I have tried a number of boards to rule out a hardware issue. I have 4 boards, all the same format, all with the same boot loader code. 2 function as expected without needing a reset on power up, and 2 will not work until physically reset.
Has anybody any experience of this differing behaviour between apparently identical boards?
Thanks
2022-09-09 03:35 AM
Hi,
I would suspect an effect coming from the ST-Link not being properly powered/starting up. What is the setting of JP1? I would also experiment with closing SB107 or opening SB111 (Putting ST-Link into reset state / decoupling F7 reset from ST-Link).
BR, Ulysses
2022-09-12 01:54 AM
Thanks for getting back to me.
JP1 is open
Manually closing briefly SB107 after power up makes the board function
Opening SB111 prevented the programmer from resetting the micro-controller.
Adding a short delay at the start of main() has fixed the startup issue so I will continue with this rather than modifying the boards.
Thanks to everyone who gave constructive responses, much appreciated.
Ian