Skip to content

GCC support #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

GCC support #12

wants to merge 11 commits into from

Conversation

wavexx
Copy link

@wavexx wavexx commented Mar 24, 2024

This is based on #2 + #9, which works on current main branch with gcc-arm-noeabi 13.2.1.
Includes a few tweaks to fix the status bar as well (mentioned on #2).
Everything works as expected as far as I can see.

Memory region         Used Size  Region Size  %age Used
             RAM:        2176 B         4 KB     53.12%
           FLASH:       11680 B        16 KB     71.29%
          EEPROM:          0 GB        448 B      0.00%

Special thanks to @bmigette for pyocd/pyOCD#1646 which got me going.

@surfdado
Copy link
Owner

Hi, thanks for all this - Lukash told me about you. Could you please join the Floatwheel Discord if you haven't already? There's a lcm-development channel. There's a few others who have been trying their luck with gcc support, I'd like them to try your changes.

@surfdado
Copy link
Owner

void main(void) doesn't compile with Keil Studio so I changed it back to int main(void and added a return 0; at the end

@wavexx
Copy link
Author

wavexx commented Aug 18, 2024

Sorry I was absent for a bit, but reporting my findings:

  • works correct, for the most part
  • it looks like there are some issues with ADC sampling. Occasionally the read voltages seem to be off, resulting in the status bar generally showing one red led only. Since this happens occasionally while riding, it's kind of annoying to debug
  • for the same reason, it can occasionally be seen while charging (at the end of the charging cycle)
  • I switched back to the original keil build for testing, and after a few weeks I noticed the original build also does the same, albeit much more rarely.

Pure guesswork so far, but I suspect there's some timing/isr issue already, and the gcc build just makes it more apparent.

fromeijn and others added 11 commits August 18, 2024 17:34
Based on 46c875c, except it removes
completely the usage of floor() we don't need.
TI*_Config are static to hk32f030m_tim.c
- Remove unnecessary linker flags
- Pass -flto also as a linker flag
- Remove warning on RWX segments with gcc 13
We're not using any libc function, so drop nano/nosys specs and use
nostdlib directly.

Stub _init() to get the default implementation of __libc_init_array.
Prevent a few delay loops from being elided
@wavexx
Copy link
Author

wavexx commented Aug 18, 2024

Fixed the main declaration and rebased. Untested (for the moment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants