-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Describe the bug
Building for BBC micro:bit against v1.14.0-rc2 I found that often (but not always) the resultant hex file would not copy onto the device over USB. micro:bit is an mbed device and flashing involves copying the binary hex file to a target USB drive. Copying would fail like this:
C:\workspaces\zephyr_projects\peripheral_hr\build>copy zephyr\zephyr.hex d:
The system cannot find the file specified.
0 file(s) copied.
and the mbed USB drive would disconnect. Physically unplugging the USB cable and plugging it in again would bring back the mbed drive.
The hello_world sample project builds and installs OK.
The bluetooth/peripheral_hr project exhibits the problem.
To Reproduce
Steps to reproduce the behavior:
- Check out tag
- Set up the bluetooth/peripheral_hr project for BBC micro:bit with
cmake -GNinja -DBOARD=bbc_microbit ..
- Build with
ninja
- Attempt to install to a USB connected micro:bit (assuming assigned drive letter is D: on Windows)
copy zephyr\zephyr.hex d:
Expected behavior
The hex file should successfuly copy to the mbed drive and the mbed drive should stay connected to the host computer:
C:\workspaces\zephyr_projects\peripheral_hr\build>copy zephyr\zephyr.hex d:
1 file(s) copied.
Instead, this happens:
C:\workspaces\zephyr_projects\peripheral_hr\build>copy zephyr\zephyr.hex d:
The system cannot find the file specified.
0 file(s) copied.
Impact
Have to work with 1.14.0-rc1. Showstopper for 1.14.0 if this is not fixed though.
Screenshots or console output
Environment (please complete the following information):
- OS: Windows
- Toolchain: Zephyr 1.14.0-rc2 with ninja
- Commit SHA or Version used
I used git bisect and determined that the following commit is probably where the problem was introduced:
af10d16 is the first bad commit
commit af10d16
Author: Daniel Leung daniel.leung@intel.com
Date: Sat Mar 9 00:58:57 2019 -0800
linker: sort sections by alignment
This turns on the linker flag to sort sections by alignment
in decreasing size of symbols. This helps to minimize
padding between symbols.
This also adds the linker options to sort common symbols by
alignment in descending to minimize the need for padding.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
:100644 100644 4e04694a38b07ddb063b7755bdbe932dd87b7de5 3ab4ef394cce8ea560304345f9d91165a77b54da M CMakeLists.txt
Additional context
It's been pointed out to me that this commit has relevance: