cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Resetting Nucleo-F091

kvresto
Senior
Posted on December 10, 2016 at 00:53

Hi Everyone.

I have a very strange problem with a Nucleo-F091RC board. I've been playing around with a serial

program just to print messages via the uart, just to get the first project started. I noticed

as long as I was programming the board and resetting it without removing the power (USB cable) from the board

everything worked fine. But when I removed the power (USB cable) and the reconnected the power to the board

it stopped working. With my DSO I noticed the uart TX line worked briefly, then the cpu stopped, no amount

of resetting could get this app working again, I had to reprogram the cpu to get it to work.

Is this some sort of sleep or stop mode thing going on?

Thanks

kvresto
9 REPLIES 9
Posted on December 10, 2016 at 01:59

You'd need to review what the code is doing, and if there are any dependencies on clocks or GPIO banks that need enabling. The debugger can alter the state of things to suit its needs.

Use the ST-LINK Utilities to inspect the content of the Flash memory, and compare that against what should have been written there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kvresto
Senior
Posted on December 10, 2016 at 02:51

Hi Clive.

My code is simply printing hello world in a loop.

I'm not sure I understand what you are recommending I do?

Recap:

a) If I reprogram and keep power applied, all works ok.

b) If I remove power, and re-power,... board stops working.

c) Monitoring TX line via DSO, and re-power board, I see very brief activity on tx line, then nothing, all stopped. This brief activity on TX line is ONLY on the very first power re-application.

d) No amount of resetting, re powering will show any activity on TX line, until I reprogram the board.

Now loop back to the top

Thanks Clive, I'm lost on this one, how can I send you a pic from ST-LINK Utilities, target option byte?

maybe there is something there?

cheers

kvresto
Senior
Posted on December 10, 2016 at 04:02

 0690X00000603UhQAI.jpg

Clive here is the complete main.

int main(void)

{

 HAL_Init();

 SystemClock_Config();

 MX_GPIO_Init();

 MX_SPI1_Init();

 MX_USART2_UART_Init();

 MX_USART3_UART_Init();

 //MX_FATFS_Init();

 print_dbg(&huart2, ''\r\nNucleo-F091RC\r\n'');

 print_dbg(&huart3, ''\r\nNucleo-F091RC\r\n'');

 while(1)

 {

   //loop_test();

   HAL_Delay(500);

   print_dbg(&huart2, ''\r\nloop'');

   print_dbg(&huart3, ''\r\nloop'');

 }

}
kvresto
Senior
Posted on December 10, 2016 at 04:15

Clive it doesn't matter what code it is, I've also tried it with a simple toggling of the led in the while loop.

Posted on December 10, 2016 at 03:49

Well you can attach images here via the camera icon, and paste code fragments directly.

There is likely other code running, configuring clocks and pins. If your code is simple, then dig deeper. I could build an example of 'Hello World!' to the Nucleo VCP, but I don't have a F0 build system close at hand right now.

There is the state of the BOOT0 pin, and an option for BOOT1. I doubt the pin on the Nucleo is doing odd things, and you could explain the state of the options.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kvresto
Senior
Posted on December 12, 2016 at 23:57

Anyone have any ideas??

Posted on December 13, 2016 at 03:03

Like I said, you should look at the content of the flash memory, what you wrote and functioned, vs what is in there and not. Doesn't the utility provide a means of checksumming? Can you compare/verify? Worst case get the binary data to a file and FC or COMP the thing.

Make sure you have current firmware on the board (ST-LINK), and that there isn't anything weird going on with the mbed mass-storage controller interface.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kvresto
Senior
Posted on December 13, 2016 at 08:27

Sure Clive, I was not sure why you asked to compare flash memory with my bin file, but here is what I found.

1) newly loaded file into cpu without disconnecting and reconnecting power, file and flash compare successfully. See pic

2) When I disconnect power, and reconnect power, then I perform a device memory with bin file compare, then it fails,

   flash and device memory are not the same, large chunks at the start of flash seem to have bee erased.

  

   See pics

  

   I haven't trolled through the data sheet as yet,.... do I have to, it should work straight out of the box?

3 pics below, of success & failed compares.

Does this mean anything to anyone familiar with this cpu series, or perhaps programmer issue??

   

   kvresto0690X00000603PtQAI.jpg0690X00000603VQQAY.jpg0690X00000603VaQAI.jpg
kvresto
Senior
Posted on December 14, 2016 at 01:42

Hi Everyone, just an update, I updated STLINK firmware and that seems to have fixed it. Funny I swear that was the first thing I did when I plugged in the board for  the first time, before I discovered my day was ruined. Anyway thanks again Clive One.

kvresto