Skip to content
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

Add experimental GCC ARM toolchain #678

Closed
wants to merge 11 commits into from

Conversation

xiongyihui
Copy link
Contributor

To support GCC ARM toolchain:

  1. convert some attributes

    • __weak to __attribute__((weak))

    • __forceinline to inline __attribute__((always_inline))

    • __packed to __attribute__((__packed__)), also need to change its location, for example

      convert __packed struct { char a; int b; } c; to struct __attribute__((__packed__)) { char a; int b; } c;.
      it is used by USB stack

  2. wide character array defined by L"a wide string"

    By default, gcc uses 4 bytes to store a wide char, while armcc uses 2 bytes. In order to be compatible with armcc, add -fshort-wchar to gcc compiler flags.

  3. convert asm code

Right now, it work partially. To test it.

rm source/daplink/interface/SVC_Table.s
progen generate -f projects.yaml -p lpc11u35_archble_if_bm -t make_gcc_arm
cd projectfiles/make_gcc_arm/lpc11u35_archble_if_bm
make

@xiongyihui
Copy link
Contributor Author

@0xc0170 Do you have any idea that the gccarm firmware shows an empty disk? Which part of code is related?

image

@brianesquilona
Copy link
Contributor

@0xc0170 Do you have any idea that the gccarm firmware shows an empty disk? Which part of code is related?

image

@xiongyihui you might want to check all msc related codes in source/usb.

@xiongyihui
Copy link
Contributor Author

I figured out the issue. It is that cfgrom and cfgram are not configured at the linker script.

@xiongyihui
Copy link
Contributor Author

It seem armcc uses much less RAM and Flash than gccarm. LPC11U35 doesn't have enough to run the interface firmware compiled with gccarm, even if without RTX RTOS.
A workaround is to make target_device to a const variable

@flit
Copy link
Collaborator

flit commented Nov 23, 2019

See the latest on #197. I'm almost done with the official port to gcc. Very unfortunately coincidental timing between us! 😔 I do very much appreciate your collaborative interest and effort. If you'd like to help test my gcc port, this would be appreciated.

@flit flit closed this Nov 23, 2019
@xiongyihui
Copy link
Contributor Author

I see. I will test that.

@@ -53,6 +53,9 @@ module:
hic_lpc11u35: &module_hic_lpc11u35
- records/rtos/rtos-cm0.yaml
- records/hic_hal/lpc11u35.yaml
hic_lpc11u35_bm: &module_hic_lpc11u35_bm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As these might not be related to GCC port, please send t hem separately or after GCC support lands on master.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 25, 2019

@xiongyihui Thanks for the effort ! Please review and test https://github.com/flit/DAPLink/tree/feature/gcc

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.

None yet

4 participants