Board loses program after boot

Post here first, or if you can't find a relevant section!
mortenholm
Posts: 8
Joined: Fri Jul 24, 2015 11:19 am

Board loses program after boot

Post by mortenholm » Fri Jul 24, 2015 11:23 am

Hi

I successfully uploaded a sketch to my board setting boot0 high and it works, but if i set it low and boot (or powercycle) the board, it doesn't start running my sketch.

Any input?

Morten

User avatar
RogerClark
Posts: 7690
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Board loses program after boot

Post by RogerClark » Fri Jul 24, 2015 9:19 pm

Thats strange.

It used to work, however most people now install the bootloader onto their board as its an overall easier process.

Can you give more details about your board and upload method, as the repo supports over a dozen boards, each with multiple upload methods.

mortenholm
Posts: 8
Joined: Fri Jul 24, 2015 11:19 am

Re: Board loses program after boot

Post by mortenholm » Fri Jul 24, 2015 9:35 pm

The board is this one: http://www.ebay.com/itm/251451881909

I'm uploading through serial using an FTDI tool.

User avatar
RogerClark
Posts: 7690
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Board loses program after boot

Post by RogerClark » Fri Jul 24, 2015 9:53 pm

Yikes

That board is known on the forum as the Ugly board.

I have one. But i dont use it any more. It had multiple manufacturing faults, also it seems to be missing a critical resistor pullup which means the USB doesnt work properly, hence the bootloader doesnt always work on this board.

Anyway, all that being said.

Please can you tell us, what board you selected, what version of Arduino IDE you are using, when you downloaded and installed to core files, and what you mean by your sketch "doesnt work"

mortenholm
Posts: 8
Joined: Fri Jul 24, 2015 11:19 am

Re: Board loses program after boot

Post by mortenholm » Fri Jul 24, 2015 10:05 pm

Sure. I have selected the 'Generic STM32F103C series' and i have tried both the 64k and 128k versions (stm32flash reports 128k). The Arduino IDE is 1.6.5. I downloaded and installed the core files around July 8th.

Doesn't work means that it doesn't seem to execute my code.

I have tried adding the '-v' option to the 'serial_upload' script and it sometimes fails to verify the writes - the funny thing is that even though the verification fails the sketch runs fine.

Maybe i should just ditch the board and use my other board (http://www.ebay.com/itm/321569700934) that works just fine.

User avatar
RogerClark
Posts: 7690
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Board loses program after boot

Post by RogerClark » Fri Jul 24, 2015 10:10 pm

I will double check with my Ugly board, but I'd recommend, at least to start with, that you use your other board.
The forum calls that board the BluePill, lots of people use them.

I think they have the led on pin PC13. I'd recommend you flash the bootloader to your BluePill board, its much easier than having to press reset and changing jump links.

I did a video about the Maple mini initial operation when its brand new, Id recommend you take a quick look at that video on youtube as it describes the windows drivers etc and the important initial upload of the first sketch etc

User avatar
RogerClark
Posts: 7690
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Board loses program after boot

Post by RogerClark » Sat Jul 25, 2015 4:24 am

I've taken a look with my Ugly board and mine does not work either if I upload then put boot0=LOW

I've compared the operation with the RedPill board, and its just the Ugly board that won't start after cold boot.

I suspect there is some design fault on that board, to do with supply voltages at start-up

I think Rick Kimball has one of these boards and his works with the bootloader, so perhaps his generally works ok after cold boot, but mine does not ;-(

Re: Enumeration after stlink upload
I've taken a look at boards.txt and I think you may be referring to the Serial USB re-enumerating rather than the STLink re-enumerating, as USB Serial is enabled for STLink.
However if this enumeration issue was on the Ugly board, its almost certainly the hardware startup issue.

User avatar
ahull
Posts: 1729
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Board loses program after boot

Post by ahull » Sat Jul 25, 2015 8:39 am

I use an st-link to flash my "Ugly board" as anything else tends to be unreliable. You also need to make sure the boot jumpers are set correctly.
I've left the board in my office, but I think this picture shows the correct jumper settings.

Image

Also read the following post if you intend to try to use VBAT and the on board RTC on this board.

viewtopic.php?f=3&t=22&hilit=magic+smoke&start=10#p1558
- Andy Hull -

User avatar
RogerClark
Posts: 7690
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Board loses program after boot

Post by RogerClark » Sat Jul 25, 2015 11:09 am

Andy,

Strangely I get the same issue as the OP.

I can upload via Serial, and it runs fine i.e because the hardware bootloader gets sent the run / go command to execute from 0x800000 after the upload is complete.

However if I move Boot0 to Low and press reset, the board doesn't run the code. (I just had a simple sketch the prints numbers ever 1 sec to Serial (in this case Hardware Serial 1).

The only thing I can think of that would cause this, is some sort of messy start-up and reset hardware, which seems very strange.
i.e I tried power cycling and it has the same issue, as well as when I press reset.

But I hardly ever use this board, as I prefer my RedPill's or F103VET's or the Maple mini's

kelapuress
Posts: 3
Joined: Sat Nov 25, 2017 1:42 pm

Re: Board loses program after boot

Post by kelapuress » Fri Jan 12, 2018 7:14 am

I know this is an old post but I am facing the same issue with a custom made board which uses STM32L072CZ or just say Murata LoRa chip as in DISCO-L071CZ-LRWAN1 board. I flash the code, the code starts executing(printing "hello world") but when I power OFF and turn it ON, it does not execute anymore. By the way, I use BOOT0 high when flashing and pull it to low when using in application mode.

How did you guys solve it?

Post Reply