[fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
User avatar
BennehBoy
Posts: 886
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by BennehBoy » Thu Jan 24, 2019 4:11 pm

Each to their own :lol:
-------------------------------------
https://github.com/BennehBoy

User avatar
mrburnette
Posts: 3001
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by mrburnette » Fri Jan 25, 2019 12:56 am

BennehBoy wrote:
Thu Jan 24, 2019 4:11 pm
Each to their own :lol:
True. But, the LOL should be more of a geek'ish icon. I prefer 8-)

fredbox
Posts: 211
Joined: Tue Jul 07, 2015 4:44 pm

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by fredbox » Sat Jan 26, 2019 5:59 pm

I've updated to the latest fpiSTM Github code from yesterday and modified boards.txt and ldscript.ld for the 32k parts. I don't have a Github account, so here are my changes if anyone else needs them:

3 lines changed in variants/BLUEPILL_F103C8/ldscript.ld:

Code: Select all

-**                64/128KByte FLASH, 20KByte RAM
+**                32/64/128KByte FLASH, 10/20KByte RAM
-_estack = 0x20005000;    /* end of RAM */
+_estack = 0x20000000 + LD_MAX_DATA_SIZE;    /* end of RAM */
-RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 20K
+RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
8 lines added to boards.txt:

Code: Select all

+# BLUEPILL_F103C6 board
+# Support: Serial2 (USART2 on PA3, PA2) and Serial3 (USART3 on PB11, PB10)
+GenF1.menu.pnum.BLUEPILL_F103C6=BluePill F103C6 (32K)
+GenF1.menu.pnum.BLUEPILL_F103C6.upload.maximum_size=32768
+GenF1.menu.pnum.BLUEPILL_F103C6.upload.maximum_data_size=10240
+GenF1.menu.pnum.BLUEPILL_F103C6.build.board=BLUEPILL_F103C8
+GenF1.menu.pnum.BLUEPILL_F103C6.build.product_line=STM32F103xB
+GenF1.menu.pnum.BLUEPILL_F103C6.build.variant=BLUEPILL_F103C8
+
# BLUEPILL_F103C8 board
Blinky:

Code: Select all

Sketch uses 9228 bytes (28%) of program storage space. Maximum is 32768 bytes.
Global variables use 552 bytes (5%) of dynamic memory, leaving 9688 bytes for local variables. Maximum is 10240 bytes.

User avatar
BennehBoy
Posts: 886
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by BennehBoy » Sat Jan 26, 2019 6:33 pm

fredbox wrote:
Sat Jan 26, 2019 5:59 pm
I've updated to the latest fpiSTM Github code from yesterday and modified boards.txt and ldscript.ld for the 32k parts. I don't have a Github account, so here are my changes if anyone else needs them:

3 lines changed in variants/BLUEPILL_F103C8/ldscript.ld:

Code: Select all

-**                64/128KByte FLASH, 20KByte RAM
+**                32/64/128KByte FLASH, 10/20KByte RAM
-_estack = 0x20005000;    /* end of RAM */
+_estack = 0x20000000 + LD_MAX_DATA_SIZE;    /* end of RAM */
-RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 20K
+RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
8 lines added to boards.txt:

Code: Select all

+# BLUEPILL_F103C6 board
+# Support: Serial2 (USART2 on PA3, PA2) and Serial3 (USART3 on PB11, PB10)
+GenF1.menu.pnum.BLUEPILL_F103C6=BluePill F103C6 (32K)
+GenF1.menu.pnum.BLUEPILL_F103C6.upload.maximum_size=32768
+GenF1.menu.pnum.BLUEPILL_F103C6.upload.maximum_data_size=10240
+GenF1.menu.pnum.BLUEPILL_F103C6.build.board=BLUEPILL_F103C8
+GenF1.menu.pnum.BLUEPILL_F103C6.build.product_line=STM32F103xB
+GenF1.menu.pnum.BLUEPILL_F103C6.build.variant=BLUEPILL_F103C8
+
# BLUEPILL_F103C8 board
Blinky:

Code: Select all

Sketch uses 9228 bytes (28%) of program storage space. Maximum is 32768 bytes.
Global variables use 552 bytes (5%) of dynamic memory, leaving 9688 bytes for local variables. Maximum is 10240 bytes.
I'll submit a PR
-------------------------------------
https://github.com/BennehBoy


fredbox
Posts: 211
Joined: Tue Jul 07, 2015 4:44 pm

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by fredbox » Sat Jan 26, 2019 8:38 pm

I changed 3 lines in ldscript.ld - I only see one line changed in the pull request. Thanks for doing this.

User avatar
BennehBoy
Posts: 886
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by BennehBoy » Sun Jan 27, 2019 9:13 am

Good point :D
-------------------------------------
https://github.com/BennehBoy

User avatar
BennehBoy
Posts: 886
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by BennehBoy » Mon Jan 28, 2019 10:37 pm

@fredbox, have you managed to test the PR?
-------------------------------------
https://github.com/BennehBoy

fpiSTM
Posts: 722
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France
Contact:

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by fpiSTM » Tue Jan 29, 2019 10:32 am

Guys,
I've made a fix to build properly for a C6.
Number of peripheral is not the same between STM32F103C6 and CB
C6 does not have USART3 and TIM4.
https://github.com/BennehBoy/Arduino_Core_STM32/pull/1

User avatar
BennehBoy
Posts: 886
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: [fake-stm32-blue-pill-board] STM32F103C8T6 Bootloader/Sketch problems

Post by BennehBoy » Tue Jan 29, 2019 2:32 pm

Thanks Frederic, as per github I'll merge later (I'm at the office).
-------------------------------------
https://github.com/BennehBoy

Post Reply