[SOLVED] STM32F103CBT6 BOOT Problem

Nawfal
Tue Aug 29, 2017 3:01 pm
Hi,
I just received an SDR board that I have designed.
I am using an STM32F103CBT6 to control over SPI and I2C some other components.
The USB on the microcontroller is only used to power the board. So the programming is done from the arduino IDE through ST-LINK.
So far I was able to download a led blink sketch…..But the problem I got is that after powering down the board it seems that the microcontroller does not boot.
Please find the attached file for the schematics of the µC.

I’m using the Arduino IDE 1.6.11 under Windows 7.32
GCC 4.8.3
STM32DUINO Version: 26/08/2017

Board selected: Generic STM32F103C Series
Variant: STM32F103CB (20k RAM, 128k flash)
CPU Speed :72MHz

Any Help?????


Rick Kimball
Tue Aug 29, 2017 3:16 pm
What is BOOT1 connected to?

Nawfal
Tue Aug 29, 2017 3:22 pm
It’s not connected

martinayotte
Tue Aug 29, 2017 3:27 pm
It needs to be pulled-down …

Nawfal
Tue Aug 29, 2017 3:29 pm
Is there a way to pull it down by software????

martinayotte
Tue Aug 29, 2017 3:32 pm
No ! you need to add an external pull-down.

racemaniac
Tue Aug 29, 2017 3:38 pm
If i read his schematic correctly, doesn’t he pull boot0 down? so shouldn’t it just work? (as the state of boot1 doesn’t matter when boot0 is pulled down)

Rick Kimball
Tue Aug 29, 2017 3:40 pm
[racemaniac – Tue Aug 29, 2017 3:38 pm] –
If i read his schematic correctly, doesn’t he pull boot0 down? so shouldn’t it just work? (as the state of boot1 doesn’t matter when boot0 is pulled down)

He will get inconsistent results when he does push the boot0 button and it pulls up.


Nawfal
Tue Aug 29, 2017 3:41 pm
[martinayotte – Tue Aug 29, 2017 3:32 pm] –
No ! you need to add an external pull-down.

I pull it down during programming….same issue


Rick Kimball
Tue Aug 29, 2017 3:43 pm
You said you loaded the blinky sketch. You didn’t say if it works. Have you seen it work?

Nawfal
Tue Aug 29, 2017 3:44 pm
[Rick Kimball – Tue Aug 29, 2017 3:43 pm] –
You said you loaded the blinky sketch. You didn’t say if it works. Have you seen it work?

Yes, it’s working fine…..the timing also works fine


Rick Kimball
Tue Aug 29, 2017 3:48 pm
Do you leave the stlink connected when you power off and on? Or are you disconnecting the stlink device?

Nawfal
Tue Aug 29, 2017 3:49 pm
[Rick Kimball – Tue Aug 29, 2017 3:48 pm] –
Do you leave the stlink connected when you power off and on? Or are you disconnecting the stlink device?

I leave it connected. I tried removing it before and after the power cycle and It’s giving the same results


Rick Kimball
Tue Aug 29, 2017 3:51 pm
Do you leave the stlink powered on?

Have you tried disconnecting the stlink?

What is the voltage of your VDD when you measure it with a meter?


Nawfal
Tue Aug 29, 2017 3:53 pm
[Rick Kimball – Tue Aug 29, 2017 3:51 pm] –
Do you leave the stlink powered on?

Have you tried disconnecting the stlink?

What is the voltage of your VCC when you measure it with a meter?

The voltage is 3.28V
And yes, I tried disconnecting the ST-Link without succes so far


Rick Kimball
Tue Aug 29, 2017 3:54 pm
Why does your schematic show SWD connected to LMS 3v3?
——– … never mind … that is not SWD but the target voltage.

Nawfal
Tue Aug 29, 2017 3:56 pm
[Rick Kimball – Tue Aug 29, 2017 3:54 pm] –
Why does your schematic show SWD connected to LMS 3v3?

It is the output from a voltage regulator


Rick Kimball
Tue Aug 29, 2017 3:58 pm
Do you know how to use arm-none-eabi-gdb .. maybe it is booting up but encountering some other error before it is able to run the loop() function

You might start up st-util and put a breakpoint on the reset routine and step through


Nawfal
Tue Aug 29, 2017 3:58 pm
Do I need to use a bootloader though I am using the ST-LINK???

Nawfal
Tue Aug 29, 2017 3:59 pm
[Rick Kimball – Tue Aug 29, 2017 3:58 pm] –
Do you know how to use arm-none-eabi-gdb .. maybe it is booting up but encountering some other error before it is able to run the loop() function

You might start up st-util and put a breakpoint on the reset routine and step through

No, do you have some link where I can look at??


Rick Kimball
Tue Aug 29, 2017 4:00 pm
You should be using the ST-LINK upload method and no you don’t need a bootloader. Selecting ST-Link as the upload method will load your code at 0x08000000 and would erase and replace the bootloader with whatever sketch you loaded.

Nawfal
Tue Aug 29, 2017 4:02 pm
[Rick Kimball – Tue Aug 29, 2017 4:00 pm] –
You should be using the ST-LINK upload method and no you don’t need a bootloader. Selecting ST-Link as the upload method will load your code at 0x08000000 and would erase and replace the bootloader with whatever sketch you loaded.

Yes, This was my first impression


Rick Kimball
Tue Aug 29, 2017 4:03 pm
I don’t there have been some discussions here however that are more geared towards using it with eclipse.

Nawfal
Tue Aug 29, 2017 4:06 pm
[Rick Kimball – Tue Aug 29, 2017 4:03 pm] –
I don’t there have been some discussions here however that are more geared towards using it with eclipse.

I used to play with the STM32F7 on eclipse….A real headack….I opted for the STM32DUINO for the simplicity and for not having to write dozens of lines to blink an LED


Nawfal
Tue Aug 29, 2017 4:36 pm
Any Other suggestions???

Rick Kimball
Tue Aug 29, 2017 4:51 pm
I would spend some time in the debugger. I’m wondering about your LED being on the 32k xtal pins. I might move that. Not sure if the generic stm32f103c libmaple core tries to initialize it.

stevestrong
Tue Aug 29, 2017 6:21 pm
You probably uploaded a code in which the SWD interface got disabled, that is why you cannot upload over STLink anymore.
On maple mini the debug interface is disabled by default, I think.
To enable the debug interface again, you have to build another software version in which you insert in your setup code:
enableDebugPorts();

Nawfal
Thu Aug 31, 2017 12:04 pm
It’s not working neither….I’ll give it a try using eclipse and I’ll let you know

Nawfal
Thu Aug 31, 2017 4:41 pm
It’s not working under eclipse neither :(
Is there some fuse setting on STM32 µCs identical to the ones on AVRs ??? I’ve seen some settings on the st-link utility:
MCU core and Option bytes….Anyone knows what these things are about???

Pito
Thu Aug 31, 2017 5:24 pm
Try in ST_LINK
1. Erase Chip and then
2. Program&Verify.

Rick Kimball
Thu Aug 31, 2017 5:25 pm
Do you have a supported device like a bluepill? a Maple Mini? So other STM32F1 board that is known to work? If so you might try using that to verify that you can debug any board. If it does work, then because you have a custom board, I would start looking at your custom board connections and layout. We can only guess what you have and what is wrong with it. … which we have been doing all along.

Nawfal
Thu Aug 31, 2017 5:46 pm
[Rick Kimball – Thu Aug 31, 2017 5:25 pm] –
Do you have a supported device like a bluepill? a Maple Mini? So other STM32F1 board that is known to work? If so you might try using that to verify that you can debug any board. If it does work, then because you have a custom board, I would start looking at your custom board connections and layout. We can only guess what you have and what is wrong with it. … which we have been doing all along.

Yes….And it’s working as expected after a power cycle (even though the boot0 and boot1 are kept floating or as 1 and 0)….
The layout, I guess is correct since the system is working perfectly after programming it.


Pito
Thu Aug 31, 2017 5:55 pm
[Nawfal – Thu Aug 31, 2017 5:46 pm] –
Yes….And it’s working as expected after a power cycle (even though the boot0 and boot1 are kept floating or as 1 and 0)….

What “it” is working as expected? – pls do answer with details, to avoid confusion. Always state the board you use with the test and core (libmaple or other).


Nawfal
Thu Aug 31, 2017 5:56 pm
[Pito – Thu Aug 31, 2017 5:55 pm] –

[Nawfal – Thu Aug 31, 2017 5:46 pm] –
Yes….And it’s working as expected after a power cycle (even though the boot0 and boot1 are kept floating or as 1 and 0)….

What “it” is working as expected? – pls do answer with details, to avoid confusion.

the mimi maple clone


Pito
Thu Aug 31, 2017 6:00 pm
Maple Mini’s boot0 is 0 unless the button is pressed down (then 1).
Can you post your sketch plz?

Nawfal
Thu Aug 31, 2017 7:08 pm
I figured out what was wrong.
For some reason the boot0 get stuck on logic 1 (3V) either pressing the corresponding button or releasing it.
So I decided to remove the R30 and R33 (See post 1) and now it’s working :D
Apparently, I made some mistake with the library layer’s button eagle design

Leave a Reply

Your email address will not be published. Required fields are marked *