Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post here all questions related to LibMaple core if you can't find a relevant section!
User avatar
fpiSTM
Posts: 856
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 33
Location: Le Mans
Contact:

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by fpiSTM »

Which arm none eabi gcc toolchain you used ?
And I guess you would tell -Os instead of -S0.

stevestrong
Posts: 393
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 7
Location: Munich, Germany
Contact:

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by stevestrong »

Mangy_Dog wrote:
Thu Sep 24, 2020 3:26 pm
And yes in all likely hood my c8 is a CB, but I got the chips from Ali, who knows i might just have a bunch of real 64KB chips :p Sure if i really do have 128KB i should have no issues at all... But if i am stuck with 64KB im certainly a tinsy bit worried ill go past that.
Don't worry, the initial code is unproportionally larger than the following code pieces because of the startup code.
So graphical code will probably not overflow your flash size, if you do not store bitmaps in flash.

User avatar
Mangy_Dog
Posts: 66
Joined: Sat May 02, 2020 11:45 pm

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by Mangy_Dog »

-Os sorry, just out of interest where to i put that? As for tool chain, what ever Arduino/sloeber uses with rogerclarks core.

All my bitmap assets are on sd card.... I had considered making an addition to the graphics chip library as offloading to flash chip isnt currently supported. But it would have added another load of complexity to the project and its already complex enough....
Just a dogs body developer, mostly making props and stuff...

mrburnette
Posts: 330
Joined: Thu Dec 19, 2019 1:23 am
Answers: 1

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by mrburnette »

Mangy_Dog wrote:
Thu Sep 24, 2020 3:26 pm
...
And yes in all likely hood my c8 is a CB, but I got the chips from Ali, who knows i might just have a bunch of real 64KB chips :p Sure if i really do have 128KB i should have no issues at all... But if i am stuck with 64KB im certainly a tinsy bit worried ill go past that.
Good luck. Here is the link to the old forum post on 64K vs 128K
https://stm32duinoforum.com/forum/viewt ... _2402.html

stevestrong
Posts: 393
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 7
Location: Munich, Germany
Contact:

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by stevestrong »

Mangy_Dog wrote:
Thu Sep 24, 2020 9:10 pm
-Os sorry, just out of interest where to i put that?
Select in Arduino IDE menu: Tools -> Optimize

User avatar
Mangy_Dog
Posts: 66
Joined: Sat May 02, 2020 11:45 pm

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by Mangy_Dog »

Like I say setting LTO kills the mcu. Bricks it.

and smallest default is giving me the size ive been talking about....

Something extra scary, ive been jiggling my code and reorganising it a little, and integrating freertos... and already right away my compile size has nearly doubled to 42kb...

And ive yet to actually add anything more into my project yet really D:

Though ive not removed features from freertos yet...
Just a dogs body developer, mostly making props and stuff...

mrburnette
Posts: 330
Joined: Thu Dec 19, 2019 1:23 am
Answers: 1

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by mrburnette »

Mangy_Dog wrote:
Sun Sep 27, 2020 2:29 pm
Like I say setting LTO kills the mcu. Bricks it.

and smallest default is giving me the size ive been talking about....

Something extra scary, ive been jiggling my code and reorganising it a little, and integrating freertos... and already right away my compile size has nearly doubled to 42kb...

And ive yet to actually add anything more into my project yet really D:

Though ive not removed features from freertos yet...
Then do not use that option.

You do realize you are bringing the pain upon yourself by failing to select the proper uC with an appropriate flash size. Because you are relying on a hunch that your 64K chips may have 128K.

I understand your dilemma, you have an investment in Chinese manufactured boards procured before consideration of code size. But seriously, is that not a personal problem? And I warned you about the RTOS integration... but I do hope you succeed.

This mess was discussed many times in the old forum and I always was posting warning readers to not consider the 64K "extra" on some boards to be a gift - rather it is a distraction and cannot be relied upon and ultimately will cause grief.

User avatar
Mangy_Dog
Posts: 66
Joined: Sat May 02, 2020 11:45 pm

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by Mangy_Dog »

I never planned on the 64kb chip being 128kb...
The plan was to always fit it within 64kb...

I just didn't know there would have been such a big overhead in stm32 over the avr....

Honestly I didn't expect the same code to end up being 2 to 3 times the size... Which is why I felt the 64kb chip was more than enough even with the display code added.... As I was basing it on the size of code for my avr version...

I've reincorporated some of my other code from the avr version I'm now about 45kb in... I've yet to bring in and tune my serial framing code, and the 6 or more other UI pages I need to make.............. Sighs. Will in all likely hood go over 64kb at this rate.
Just a dogs body developer, mostly making props and stuff...

mrburnette
Posts: 330
Joined: Thu Dec 19, 2019 1:23 am
Answers: 1

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by mrburnette »

Just a thought, but if the worst happens, you may move the UI code to one of the super cheap 328P Mini. The extra 32K of flash should easily handle the UI flash requirements.

You could roll your own comms between the two chips or maybe even explore moving entire structures:
https://github.com/LowPowerLab/RFM69/tr ... r/Examples
Re: Struct_send & Struct_receive

Of course, if you ran the 328P-PU at 8MHz, just the uC is all you would require and stay at 3.3 Volts throughout the design.

User avatar
Mangy_Dog
Posts: 66
Joined: Sat May 02, 2020 11:45 pm

Re: Multiple problems - LTO killing MCU, USB stack issues, How to install chibios?

Post by Mangy_Dog »

Funnily i have a 328 in the project but its in another part of the design, and no way to connect it to the display as its in a seporate enclosure... I already have serial coms talking between the two mcus...

Anyway hopefully ill be ok. Ive incorporated most of the code and i still have 20kb left.... Soooo if im really careful i might be able to get it done within 64, and if not..... just hope its got more than 64k :D
Just a dogs body developer, mostly making props and stuff...

Post Reply

Return to “General discussion”