Mbed-os: Re-compile fails with ARM Compiler 5 and REALTEK_RTL8195AM

Created on 8 Mar 2018  路  16Comments  路  Source: ARMmbed/mbed-os

Description

  • Type: Bug
  • Priority: Minor

Bug

Target
REALTEK_RTL8195AM

Toolchain:
ARM

Toolchain version:
ARM Compiler 5 update 3

mbed-cli version:
1.3.0

mbed-os sha:
6ff720302 (mbed-os-5.8.0-rc1)

DAPLink version:

Expected behavior
Re-compile mbed-os-example-wifi example should not throw errors.

Actual behavior
Re-compile mbed-os-example-wifi example on REALTEK_RTL8195AM thrown errors:

Elf2Bin: mbed-os-example-wifi
Error: Q0147E: Failed to create Directory .\BUILD\REALTEK_RTL8195AM\ARM\mbed-os-example-wifi.bin\IMAGE2_TABLE: File exists
Finished: 0 information, 0 warning and 1 error messages.
[ERROR] Error: Q0147E: Failed to create Directory .\BUILD\REALTEK_RTL8195AM\ARM\mbed-os-example-wifi.bin\IMAGE2_TABLE: File exists
Finished: 0 information, 0 warning and 1 error messages.

Steps to reproduce

  1. import example and update to mbed-os 5.8.0-oob
    mbed import mbed-os-example-wifi
    cd mbed-os-example-wifi
    mbed update mbed-os-5.8.0-oob
  2. Compiler the example first time
    mbed compile -t ARM -m REALTEK_RTL8195AM
  3. modify wifi password in mbed_app.json
  4. Re-compile the example again
    mbed compile -t ARM -m REALTEK_RTL8195AM

The problem only happens on Re-compile. if I do a clean first, the compiling would be fine.
Only with REALTEK_RTL8195AM board, other boards are fine.
Only with ARM Compiler 5. Gcc and IAR are fine.

realtek

All 16 comments

@jamesbeyond Is this bug specific to example wifi? does this affect any other examples?

Just had a quick try, other examples have the same problem. @theotherjimmy

Thanks!

@0xc0170 This is not related to online deployment. What gave you that impression?

@theotherjimmy It doesn't look like a fix for this will make it into RC2 so we may need a known issue adding to the docs for this ?

That's true. Known issue coming.

@ARMmbed/team-realtek

Hi, this is because ARM compiler always create a temp folder with the same name as the output binary. from my observation, the only way is to os.path.exists() and remove() in arm.py:link(). @0xc0170 @samchuarm

I can think of two solutions:

  1. like @yangkunming99 mentioned, a path removal call such as shutil.rmtree() before elf2bin
  2. add --bincombined option to fromelf so it generates plain file instead of directory for multi-load regions

I personally prefer option 2 since it solves the problem and also makes armcc behave like the rest

@thegecko FYI, Realtek will likely download more than one file in the online compiler. I don't know if you were aware, or if you handle it.

I'm not aware of a way to serve more than one binary, is this a new requirement?

@tung7970 I'm not able to answer @thegecko 's question. Could you?

@thegecko Still one download. Binary files are post-processed beforehand.

Thanks! @thegecko Sorry for the noise.

fixed by #6344

Was this page helpful?
0 / 5 - 0 ratings