FYSETC / Bootloader-STM32F103

This is the bootloader for STM32F103 chips
17 stars 11 forks source link

Question about firmware start address #3

Closed sl1pkn07 closed 4 years ago

sl1pkn07 commented 4 years ago

Hi, ive tested the botloader binary in my AIOII unit

the firmware is flashed sucessful (old.bin is in SD), but is not loaded when start/reboot the unit

using marlin and uncomment this:

https://github.com/MarlinFirmware/Marlin/blob/dde8fb9efbe5ea78a718a39299c12270040a9e10/buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py#L7

or use this

for define in env['CPPDEFINES']:
    if define[0] == "VECT_TAB_ADDR":
        env['CPPDEFINES'].remove(define)
env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))
env.Replace(LDSCRIPT_PATH="buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld")

tested both without success

in the code added, y see this:

https://github.com/FYSETC/Bootloader-STM32F103/blob/master/CODE/APP/bootloaders.h#L26

and this

https://github.com/FYSETC/Bootloader-STM32F103/blob/master/CODE/APP/flash.h#L14

what is mean? what is the difference?

FLASH_START_ADDR should be 0x08010000?

how i can build the bootloader? what software?

greetings

GerogeFu commented 4 years ago

Updated , follow the new README

sl1pkn07 commented 4 years ago

now works

thanks

and now. how i can build the bootloader? is possible reduced the size like other botloaders for start the firmware at 0x08007000?. RC chips is only 256K, this gain of size is better for add more funcionality to firmware

greetings

ModMike commented 4 years ago

George,

Thank you for your help, it worked perfectly. It was important for me to get this to work because I connected a Wemos D1 Mini Pro to the 4 header pins at the CH340 chip. This disabled the USB port but now I have a wireless printer with a Web interface using ESP3D-WebUI which you are familiar with. Let me know if there is a better place to get TX and RX off the 1.1b.

Alex Kenis will probably do a youtube episode on the board and talk about the improvements. I donated a board to his channel but unfortunately it’s the older version 1.1a. He will be sure to point out all the differences and may even attempt the Wemos project if we can improve the file transfer speed of the ESP3D-WebUI.

Regards,

MT

On Jun 5, 2020, at 2:45 AM, George Fu notifications@github.com wrote:

Updated , follow the new README

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FYSETC/Bootloader-STM32F103/issues/3#issuecomment-639291596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXC6OS7TEMPKIFTJH5H2JTRVCIA7ANCNFSM4NINBTCQ.

ModMike commented 4 years ago

Sorry, one last thing.

Could you update config files on your site for the latest version of Marlin? It’s a pain to have to do a diff for new users. The one you have for the 1.1b is the same as the 1.2b, which has different settings for the TMC2208.

On Jun 5, 2020, at 2:45 AM, George Fu notifications@github.com wrote:

Updated , follow the new README

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FYSETC/Bootloader-STM32F103/issues/3#issuecomment-639291596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXC6OS7TEMPKIFTJH5H2JTRVCIA7ANCNFSM4NINBTCQ.

ModMike commented 4 years ago

Ran into another issue:

.rodata' will not fit in regionrom’

Does using the flasher reduce program?

On Jun 5, 2020, at 2:45 AM, George Fu notifications@github.com wrote:

Updated , follow the new README

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FYSETC/Bootloader-STM32F103/issues/3#issuecomment-639291596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXC6OS7TEMPKIFTJH5H2JTRVCIA7ANCNFSM4NINBTCQ.

GerogeFu commented 4 years ago

now works

thanks

and now. how i can build the bootloader? is possible reduced the size like other botloaders for start the firmware at 0x08007000?. RC chips is only 256K, this gain of size is better for add more funcionality to firmware

greetings

Yes , you can . But you need to change something. Change following 0x08010000 to the address you want. It's in STM32F103RC_fysetc.py file

env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))

And change following 64K to your address corresponding size. It's in fysetc_stm32f103rc.ld file rom (rx) : ORIGIN = 0x08010000, LENGTH = 256K - 64K

GerogeFu commented 4 years ago

Sorry, one last thing. Could you update config files on your site for the latest version of Marlin? It’s a pain to have to do a diff for new users. The one you have for the 1.1b is the same as the 1.2b, which has different settings for the TMC2208. On Jun 5, 2020, at 2:45 AM, George Fu @.***> wrote: Updated , follow the new README — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#3 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXC6OS7TEMPKIFTJH5H2JTRVCIA7ANCNFSM4NINBTCQ.

You can use the latest upstream bugfix-2.0 branch , all PRs for CHEETAH and AIO board are in upstream now. But i will update our branch too.

sl1pkn07 commented 4 years ago

now works thanks and now. how i can build the bootloader? is possible reduced the size like other botloaders for start the firmware at 0x08007000?. RC chips is only 256K, this gain of size is better for add more funcionality to firmware greetings

Yes , you can . But you need to change something. Change following 0x08010000 to the address you want. It's in STM32F103RC_fysetc.py file

env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))

And change following 64K to your address corresponding size. It's in fysetc_stm32f103rc.ld file rom (rx) : ORIGIN = 0x08010000, LENGTH = 256K - 64K

but, the bootloader always want start the firmware at 0x08010000, where and how i can change this?

like i said is the fisrt post, what and for what is this lines?

https://github.com/FYSETC/Bootloader-STM32F103/blob/a24533345d43a1d7f16c798c13b1336a395f395f/CODE/APP/bootloaders.h#L26

https://github.com/FYSETC/Bootloader-STM32F103/blob/a24533345d43a1d7f16c798c13b1336a395f395f/CODE/APP/flash.h#L14

greetings

ModMike commented 4 years ago

Just a note to say how nice it is to have George from Fysetc support us here.I for one really appreciate it and will promote your product to all my friends and influencers.

ModMike commented 4 years ago

@sl1pkn07 I downloaded STM32CubeIDE the new and free GUI tool from ST Micro. You can download it here.

I was able to download it and load the project but not a programmer so I am puzzling through it.

Edit: Never mind, there is no direct import, I only got half the stuff.

ModMike commented 4 years ago

@GerogeFu George, would it be possible for you to build the slimmest version of the bootloader, compile it, and make the necessary Marlin address changes to liberate as much memory as possible? I am not a programmer but I did try to open and look at the code to see if I could figure it out, which would take me a long time.

The board is awesome but I am no longer able to load my configs when using the SD Card firmware bootloader. I absolutely need it because I have to disable the USB port to use my WiFi board.

Thank you!

GerogeFu commented 4 years ago

@sl1pkn07 I downloaded STM32CubeIDE the new and free GUI tool from ST Micro. You can download it here.

I was able to download it and load the project but not a programmer so I am puzzling through it.

It uses KEIL to compile the project.

GerogeFu commented 4 years ago

now works thanks and now. how i can build the bootloader? is possible reduced the size like other botloaders for start the firmware at 0x08007000?. RC chips is only 256K, this gain of size is better for add more funcionality to firmware greetings

Yes , you can . But you need to change something. Change following 0x08010000 to the address you want. It's in STM32F103RC_fysetc.py file

env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000"))

And change following 64K to your address corresponding size. It's in fysetc_stm32f103rc.ld file rom (rx) : ORIGIN = 0x08010000, LENGTH = 256K - 64K

but, the bootloader always want start the firmware at 0x08010000, where and how i can change this?

like i said is the fisrt post, what and for what is this lines?

https://github.com/FYSETC/Bootloader-STM32F103/blob/a24533345d43a1d7f16c798c13b1336a395f395f/CODE/APP/bootloaders.h#L26

https://github.com/FYSETC/Bootloader-STM32F103/blob/a24533345d43a1d7f16c798c13b1336a395f395f/CODE/APP/flash.h#L14

greetings

define FLASH_START_ADDR ( 0x08070000 )

is only for test. change BOOTLOADER_FLASH_ADDR

ModMike commented 4 years ago

@GerogeFu The language barrier makes it hard to understand what everyone is saying. Cryptic references are frustrating. Could you please give us a clear explanation of what to change?

From what I understand you said change the the start address in these 2 lines:

In STM32F103RC_fysetc.py file change: #env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08010000")) to #env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08007000"))

and in fysetc_stm32f103rc.ld file change: rom (rx) : ORIGIN = 0x08010000, LENGTH = 256K - 64K to rom (rx) : ORIGIN = 0x08007000, LENGTH = 256K - 64K

And change this line in your the fysetc bootloader code:

Bootloader-STM32F103/CODE/APP/bootloaders.h change #define BOOTLOADER_FLASH_ADDR ( 0x08010000 ) to #define BOOTLOADER_FLASH_ADDR ( 0x08007000 )

What I don't understand is that the flash upload is 30K but if I change the LENGTH value in fysetc_stm32f103rc.ld file** rom (rx) : ORIGIN = 0x08007000, LENGTH = 256K - 64K

To anything other than 64K, it fails. Please explain what value I am supposed to use. I tried 256 - 32K and 256 - 48K.

Can I also recommend that you make these changes and submit a pull request? Could you also recompile the boot loader with the new address? I am not setup to compile Keil code.

Thank you.

ModMike commented 4 years ago

@GerogeFu I managed to get Keil up and running and made the changes. Unfortunately it still doesn't work.

ModMike commented 4 years ago

@GerogeFu Forgot to mention that I know the compile worked because I created a new version, changed the address back to 0X0801000, compiled, uploaded, and it worked with a very cut down marlin config.

GerogeFu commented 4 years ago

I update the README , follow it.

ModMike commented 4 years ago

George,

Everything worked this time. I attached the new .hex for anyone who might want it.

Thank you.

Bootloader-STM32F103.zip

ModMike commented 4 years ago

@GerogeFu Where is the best place to post questions? For instance I wanted to know if there were any additional available serial ports and what pins they are on?

I want to pick a better place to connect wit rx/tx

Thanks!

GerogeFu commented 4 years ago

Well , i recommend to use our forum here: https://forum.fysetc.com/

GerogeFu commented 4 years ago

And i am closing this issue , if no more doubt.

ModMike commented 4 years ago

George, one last request, where can I find the standard bootloader that came with the board? If it's the same code do I just comment out something?

I also submitted a PR to Marlin for the changes.

Thanks for all the help!

ModMike commented 2 years ago

Can the Cheetah be use with a 12v CR-10 printer?

Thanks!

MT

On Jun 10, 2020, at 3:10 AM, George Fu @.***> wrote:

 Well , i recommend to use our forum here: https://forum.fysetc.com/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.