Open drnedm opened 3 years ago
Ah, adapting the memory map makes it enumerate properly:
--- a/ld/bluepill.ld
+++ b/ld/bluepill.ld
@@ -1,7 +1,7 @@
/* Generic linker script for STM32F103RBT6/STM32F103R8T6 */
MEMORY {
- rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K
- ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
+ rom (rx) : ORIGIN = 0x08000000, LENGTH = 32K
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 4K
}
Thats the values found in unicore-mx/lib/stm32/f1/stm32f100x6.ld
Good catch, I didn't think about the RAM size. Why choosing 4K for the RAM segment length if you have 10K?
I found exactly this information in the unicore-mx/lib/stm32/f1/stm32f100x6.ld file, so I went with that. It was also set to a rom size of 128k, but the C8 has 64k I think?
I will try later today if jtag works, if yes I can play some more with those values. Maybe it would be nice if someone could verify on a C8 bluepill (actually I should receive one in the next weeks, so I can do it) if it works there with the settings for C6, then one could probably set it to the smaller settings in general, such that it will work on both chips. Or is it better to have a different platform to select in the makefile?
Having a larger FLASH size configured in the linker script is usually not a problem, as long as the binary fits it should work (if you don't try any manual FLASH operations in your code that go outside the available FLASH, of course).
I have reduced the SRAM to 10k in pull request #113
I have a blue pill board with STM32F103C6T6 instead of xC8T6. They are all over Aliexpress etc, you can either buy the board with the C8T6 or C6T6, C8 is 2-3 times the price.
As far as I can see from here: https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html they are very similar, 32/10 kB flash/ram vs 64/20 kB, and 2 UARTs instead of 3.
Judging from the binary size, DirtyJTAG should easily fit, but when flashed it does not enumerate as a USB device on a working board (verified by flashing STM32Duino and using serial via USB with it.
I'm willing to debug, and I could buy and donate a second one of those if it helps?
Here's the output of st-probe and st-flash:
and plugging that into the USB gives:
What else can I provide?