Hi Guys
Maybe there are some problems using Roger's CORE if not in conjunction with the USB bootloader?
(https://github.com/rogerclarkmelbourne/Arduino_STM32) I use Arduino IDE 1.8.5
Here is my problem: simple code
in the SETUP pinmode (PB4, INPUT_PULLDOWN)
digital.Read(PB4)
It works if I upload the sketch by USB bootloader... BUT
when I get rid of the bootloader and I use the ST-LINK V2 dongle, it doesn't work...
digital.Read(PB4) is always high... and in fact PB4 output 3.3 V
Is there some configuration of the GPIO registers in the bootloader that the core doesn't take care of ?
I tried on different Bluepills and Blackpills …
if I use normal INPUT and external resistor it works also without bootloader...
------------------------------
Ok let me try with another pin, PB5...
well it works with and without bootloader
Usually I use external Pull-up or down resistor, but now I want to save some space an components...
Is there a known reason why some pins they work without bootloader and others don't?
Thanks
Using the CORE with OR without BOOTLOADER: problems
-
- Posts: 23
- Joined: Sat Mar 21, 2020 3:18 pm
Using the CORE with OR without BOOTLOADER: problems
No, they are used by JTAG interface, SWD only needs PA13/14.mauriziostm32 wrote: ↑Fri Apr 03, 2020 10:00 am Normally PA15 - PB3 - PB4 are reserved for SWD debug (ST-LINK...)
No.mauriziostm32 wrote: ↑Fri Apr 03, 2020 10:00 am So if I want to keep using the ST-LINK I have 2 solutions: change pins... or give a try to the STM32 STM official core...
Is that right?
As I wrote, you can call
Code: Select all
enableDebugPorts();
Eventually, it may be needed to use this sequence:
Code: Select all
disableDebugPorts(); // disable all debug pins to be used for debug. All debug pins are free to be used as IO
enableDebugPorts(); // this enables the SWD interface only: PA13,14 reserved for SWD, PA15, PB3,4 can be used as IO
-
- Posts: 502
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: Using the CORE with OR without BOOTLOADER: problems
Short answer:
include early in your setup
Long info:
check this: https://github.com/rogerclarkmelbourne/ ... t-38078911
include early in your setup
Code: Select all
enableDebugPorts();
check this: https://github.com/rogerclarkmelbourne/ ... t-38078911
-
- Posts: 23
- Joined: Sat Mar 21, 2020 3:18 pm
Re: Using the CORE with OR without BOOTLOADER: problems
stevestrong wrote: ↑Fri Apr 03, 2020 8:03 am Short answer:
include early in your setupLong info:Code: Select all
enableDebugPorts();
check this: https://github.com/rogerclarkmelbourne/ ... t-38078911
Hi Steve
Thanks for the fast answer, I think I understood, but to be sure I summarize:
Normally PA15 - PB3 - PB4 are reserved for SWD debug (ST-LINK...) . Happens that these pins work with the bootloader because Roger disabled the SWD on these pins when the upload method is DFU (usb bootloader) , make sense.. you are using USB...
I suppose I cannot disable SWD debug when the upload method is ST-LINK … doing this the stlink won't be able to upload... right?
So if I want to keep using the ST-LINK I have 2 solutions: change pins... or give a try to the STM32 STM official core...
Is that right?
Thanks
Maurizio
-
- Posts: 502
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: Using the CORE with OR without BOOTLOADER: problems
No, they are used by JTAG interface, SWD only needs PA13/14.mauriziostm32 wrote: ↑Fri Apr 03, 2020 10:00 am Normally PA15 - PB3 - PB4 are reserved for SWD debug (ST-LINK...)
No.mauriziostm32 wrote: ↑Fri Apr 03, 2020 10:00 am So if I want to keep using the ST-LINK I have 2 solutions: change pins... or give a try to the STM32 STM official core...
Is that right?
As I wrote, you can call
Code: Select all
enableDebugPorts();
Eventually, it may be needed to use this sequence:
Code: Select all
disableDebugPorts(); // disable all debug pins to be used for debug. All debug pins are free to be used as IO
enableDebugPorts(); // this enables the SWD interface only: PA13,14 reserved for SWD, PA15, PB3,4 can be used as IO
-
- Posts: 23
- Joined: Sat Mar 21, 2020 3:18 pm
Re: Using the CORE with OR without BOOTLOADER: problems
Hi Steve
Ok it seems to work. Thanks
But I have 2 different results depending if I upload the code on a bluepill or on my circuit based on an stm32f103c8t6
this sequence enable the pins to work … and further uploads are successful on the bluepill...
on my circuit this sequence enable the pins to work, but the target after this is no longer visible to the STLINK...so I cannot upload anymore... I need to make some bridges to put boot0 and boot1 to 3.3 , in this way the board is visible to st-link, then I erase the chip with ST-LINK utility
But if I use only
all work in my circuit: the pins are working… and further uploads are successful...
In the BluePills I'm just testing PULL_UP and DOWN on those pins... while in my circuit many things are happening simultaneously uart2, SPI and I2c are running to read a sensor sending info to another Micro and displaying value on an LCD
I don't want to investigate the magic behind... I'm not a super expert, so as long as it is working... Steve solved. I go on with the project
Thanks Steve
Ok it seems to work. Thanks
But I have 2 different results depending if I upload the code on a bluepill or on my circuit based on an stm32f103c8t6
this sequence enable the pins to work … and further uploads are successful on the bluepill...
Code: Select all
disableDebugPorts();
delay(100);
enableDebugPorts();
on my circuit this sequence enable the pins to work, but the target after this is no longer visible to the STLINK...so I cannot upload anymore... I need to make some bridges to put boot0 and boot1 to 3.3 , in this way the board is visible to st-link, then I erase the chip with ST-LINK utility
But if I use only
Code: Select all
enableDebugPorts();
In the BluePills I'm just testing PULL_UP and DOWN on those pins... while in my circuit many things are happening simultaneously uart2, SPI and I2c are running to read a sensor sending info to another Micro and displaying value on an LCD
I don't want to investigate the magic behind... I'm not a super expert, so as long as it is working... Steve solved. I go on with the project
Thanks Steve