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

Build failure when building for LPC11U35_401 with ARMC6 #15

Closed
RonEld opened this issue Sep 8, 2019 · 11 comments · Fixed by ARMmbed/mbed-os#12134
Closed

Build failure when building for LPC11U35_401 with ARMC6 #15

RonEld opened this issue Sep 8, 2019 · 11 comments · Fixed by ARMmbed/mbed-os#12134

Comments

@RonEld
Copy link

RonEld commented Sep 8, 2019

Building the example for LPC11U35_401 with toolchain ARMC6 results in the following build error:

[Warning] @0,0: L3912W: Option 'legacyalign' is deprecated.
[Warning] @0,0: L6320W: Ignoring --keep command. Cannot find argument 'os_cb_sections'.
[Error] @0,0: L6218E: Undefined symbol _scanf_mbtowc (referred from ../BUILD/LPC11U35_401/ARMC6/mbed-os/platform/ATCmdParser.o).
[Error] @0,0: L6218E: Undefined symbol us_ticker_irq_handler (referred from ../BUILD/LPC11U35_401/ARMC6/mbed-os/targets/TARGET_NXP/TARGET_LPC11UXX/us_ticker.o).
Warning: L3912W: Option 'legacyalign' is deprecated.
Warning: L6320W: Ignoring --keep command. Cannot find argument 'os_cb_sections'.
Error: L6218E: Undefined symbol _scanf_mbtowc (referred from ../BUILD/LPC11U35_401/ARMC6/mbed-os/platform/ATCmdParser.o).
Error: L6218E: Undefined symbol us_ticker_irq_handler (referred from ../BUILD/LPC11U35_401/ARMC6/mbed-os/targets/TARGET_NXP/TARGET_LPC11UXX/us_ticker.o).
Finished: 0 information, 2 warning and 2 error messages.
[ERROR] Warning: L3912W: Option 'legacyalign' is deprecated.
Warning: L6320W: Ignoring --keep command. Cannot find argument 'os_cb_sections'.
Error: L6218E: Undefined symbol _scanf_mbtowc (referred from ../BUILD/LPC11U35_401/ARMC6/mbed-os/platform/ATCmdParser.o).
Error: L6218E: Undefined symbol us_ticker_irq_handler (referred from ../BUILD/LPC11U35_401/ARMC6/mbed-os/targets/TARGET_NXP/TARGET_LPC11UXX/us_ticker.o).
Finished: 0 information, 2 warning and 2 error messages.

[mbed] ERROR: "/usr/bin/python" returned error.
       Code: 1
       Path: "/home/roneld01/work/mbed-os-example-blinky-baremetal/mbed-os"
       Command: "/usr/bin/python -u /home/roneld01/work/mbed-os-example-blinky-baremetal/mbed-os/tools/make.py -t ARMC6 -m LPC11U35_401 --source .. --build ../BUILD/LPC11U35_401/ARMC6"

I believe the Undefined symbol _scanf_mbtowc error has been fixed in ARMmbed/mbed-os#10704 and the mbed-os.lib requires updating to latest versoin, once next Mbed OS release is published.
I believe error Undefined symbol us_ticker_irq_handler is because the targets.json doesn't have device US_TICKER for LPC11U35_401 . To resolve this, either add US_TICKER DEVICE in ``targets.jsonor add#if DEVICE_USTICKER` in the targets' us_ticker.c file

Note that same errors happen with ARM toolchain which is mentioned as supported toolchain

This was reported in the forum

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2019

To resolve this, either add US_TICKER DEVICE in ``targets.jsonor add#if DEVICE_USTICKER` in the targets' us_ticker.c file

thanks for the report. @RonEld Can you send a patch to Mbed OS fixing this us ticker?

@RonEld
Copy link
Author

RonEld commented Sep 9, 2019

@0xc0170
I don't mind doing it, but I don't have the target to test.
In addition, I don't know what's the best solution for this:

  1. add US_TICKER DEVICE in targets.json
  2. add#if DEVICE_USTICKER` in the targets' us_ticker.c file

1 means the target has us ticker, which I don't know
2 means not using the us ticker, in case there is.

Shouldn't this be done best by the partner?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2019

add#if DEVICE_USTICKER` in the targets' us_ticker.c file

This should be OK to do without target testing as long as build is all good for this target. For the 1st, we would need target testing.. However if us ticker was ported and we introduced this new define few months back, I dont see a reason why not add it - is the target usable without us ticker? It's not.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2019

cc @toyowata would you be able to test us ticker for this platform?

@toyowata
Copy link

@0xc0170 @RonEld

I just quick test for this platform. My test branch is here:
https://github.com/toyowata/mbed/tree/test_lpc11u35

I did...

  • Add USTICKER for the target
  • Add #if DEVICE_USTICKER macro in the us_ticker.c
(mbed-venv) 16:37:35 mbed-os-example-blinky-baremetal $ mbed compile -m lpc11u35_401 -t arm
[mbed] Working path "/Users/toywat01/test/nxp/mbed-os-example-blinky-baremetal" (program)
Building project mbed-os-example-blinky-baremetal (LPC11U35_401, ARMC6)

# snip

Link: mbed-os-example-blinky-baremetal
[Warning] @0,0: L3912W: Option 'legacyalign' is deprecated.
[Warning] @0,0: L6320W: Ignoring --keep command. Cannot find argument 'os_cb_sections'.
[Error] @0,0: L6218E: Undefined symbol _scanf_mbtowc (referred from BUILD/LPC11U35_401/ARM/mbed-os/platform/source/ATCmdParser.o).
Warning: L3912W: Option 'legacyalign' is deprecated.
Warning: L6320W: Ignoring --keep command. Cannot find argument 'os_cb_sections'.
Error: L6218E: Undefined symbol _scanf_mbtowc (referred from BUILD/LPC11U35_401/ARM/mbed-os/platform/source/ATCmdParser.o).
Finished: 0 information, 2 warning and 1 error messages.
[ERROR] Warning: L3912W: Option 'legacyalign' is deprecated.
Warning: L6320W: Ignoring --keep command. Cannot find argument 'os_cb_sections'.
Error: L6218E: Undefined symbol _scanf_mbtowc (referred from BUILD/LPC11U35_401/ARM/mbed-os/platform/source/ATCmdParser.o).
Finished: 0 information, 2 warning and 1 error messages.

[mbed] ERROR: "/Users/toywat01/mbed-venv/bin/python" returned error.
       Code: 1
       Path: "/Users/toywat01/test/nxp/mbed-os-example-blinky-baremetal"
       Command: "/Users/toywat01/mbed-venv/bin/python -u /Users/toywat01/test/nxp/mbed-os-example-blinky-baremetal/mbed-os/tools/make.py -t arm -m lpc11u35_401 --source . --build ./BUILD/LPC11U35_401/ARM"
       Tip: You could retry the last command with "-v" flag for verbose output
---

I still got link erros, so I changed:

  • Change default_toolchain from uARM to ARM

Now, I got no link errors. Then, I copied the mbed-os-example-blinky-baremetal binary to the target and got runtime error below:


++ MbedOS Fault Handler ++

FaultType: HardFault

Context:
R0   : 00000013
R1   : 00003355
R2   : 00000002
R3   : 00000002
R4   : 00000001
R5   : 40018004
R6   : 00000000
R7   : 0000399F
R8   : 19494B1A
R9   : 10000140
R10  : 000039C0
R11  : 000039C0
R12  : 00000000
SP   : 10001F88
LR   : 00003335
PC   : 00001F80
xPSR : 21000000
PSP  : 7821E644
MSP  : 10001F68
CPUID: 410CC200
Mode : Thread
Priv : Privileged
Stack: MSP

-- MbedOS Fault Handler --



++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0x1F80
Error Value: 0x10000180
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&tgt=LPC11U35_401
-- MbedOS Error Info --

Note that -t gcc_arm binary doesn't crash and works as expected (LED blinks every 500ms) on the target.

The LPC11U35_401 is Mbed 2 only target. There should be done proper porting/testing for Mbed OS 5 even baremetal profile?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 10, 2019

The LPC11U35_401 is Mbed 2 only target. There should be done proper porting/testing for Mbed OS 5 even baremetal profile?

baremetal should equal to mbed 2 (at least if we are concerned here about ARM toolchain). It should work.

Thanks for testing,the target is broken and no longer builds :/

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 10, 2019

Not even regular test builds? This might move to Mbed OS and should be fixed.

@RonEld
Copy link
Author

RonEld commented Sep 10, 2019

@toyowata Thanks for testing.
Perhaps the platform doesn't support usticker, and this is why USTICKER doesn't exist in targets.json?
In this case, I think we should only keep the #if DEVICE_USTICKER , which will disable usticker, pass link, but I am not sure on runtime though

@toyowata
Copy link

toyowata commented Sep 11, 2019

@RonEld

In this case, I think we should only keep the #if DEVICE_USTICKER , which will disable usticker, pass link, but I am not sure on runtime though

I removed the USTICKER feature from the target and it doesn't crash in runtime (ARMC6 build). LED blinks as expected timing and no crash report. My working branch is here: https://github.com/toyowata/mbed/tree/test_lpc11u35

@0xc0170

Not even regular test builds? This might move to Mbed OS and should be fixed.

By adding "5" in the release_versions enables greentea test build, but I got link errors because the target doesn't have enough RAM for all test cases (maybe, linker script files should be updated for the target).
By adding "requires": ["bare-metal"] in the mbed_app.json for test build with above, I got compile errors (not fond headers under the greentea-client).

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 26, 2019

@toyowata How shall we fix this issue? using your test branch and integrate it via PR to Mbed OS?

@ciarmcom
Copy link
Member

Internal Jira reference: https://jira.arm.com/browse/IOTCORE-1419

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

Successfully merging a pull request may close this issue.

4 participants