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
sim/hostfs: pass flag O_BINARY to host #8997
Conversation
Why "bypass" and not "pass"? |
fix nxstyle mixed case warning: |
15fc948
to
26b511e
Compare
edd79a3
to
83cdc64
Compare
@pkarashchenko @yamt Could your please review this PR again? |
CI break on esp32c6-devkit/coremark ====================================================================================
Configuration/Tool: esp32c6-devkit/coremark
------------------------------------------------------------------------------------
Cleaning...
Configuring...
Building NuttX...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 475k 100 475k 0 0 715k 0 --:--:-- --:--:-- --:--:-- 715k
make: *** [tools/Unix.mk:527: nuttx] Error 2
make: Target 'all' not remade because of errors.
Normalize esp32c6-devkit/coremark tools/Unix.mk 526 ifeq ($(CONFIG_INTELHEX_BINARY),y)
527 @echo "CP: nuttx.hex"
528 $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) nuttx.hex
529 $(Q) echo nuttx.hex >> nuttx.manifest
530 endif command line: riscv64-unknown-elf-objcopy -O ihex nuttx nuttx.hex @acassis @pkarashchenko Any update for the riscv toolchain recently? why would it fail here |
Nothing I'm aware of. Have you tried to rebuild that configuration locally? |
I just tried to rebuild it locally and build was successful |
@anchao @pkarashchenko I'm testing why this config broke. Locally it builds fine as you said. |
@pkarashchenko @lucasssvaz It should fail in POSTBUILD, I need some time to align the environment with ci docker, maybe related to esptool: https://github.com/apache/nuttx/blob/master/tools/esp32c6/Config.mk#L46-L62 |
I don't know which version of EDIT: It appears to be using the latest stable version. I'll check in #9014 if upgrading it has any effect. EDIT2: Nope, same thing happens. I'll try to build the docker image locally. |
@lucasssvaz $ pip install esptool==3.3.1
$ make -j12
CPP: /home/archer/code/nuttx/n1/nuttx/boards/risc-v/esp32c6/esp32c6-devkit/../common/scripts/esp32c6_rom.ld-> /home/archer/code/nuttx/n1/nuttx/boards/risc-v/esp32c6/esp32c6-devkiCPP: /home/archer/code/nuttx/n1/nuttx/boards/risc-v/esp32c6/esp32c6-devkit/../common/scripts/flat_memory.ld-> /home/archer/code/nuttx/n1/nuttx/boards/risc-v/esp32c6/esp32c6-devkiCPP: /home/archer/code/nuttx/n1/nuttx/boards/risc-v/esp32c6/esp32c6-devkit/../common/scripts/legacy_sections.ld-> /home/archer/code/nuttx/n1/nuttx/boards/risc-v/esp32c6/esp32c6-dLD: nuttx
CP: nuttx.hex
MKIMAGE: ESP32-C6 binary
esptool.py --chip esp32c6 elf2image --flash_mode dio --flash_size "4MB" -o nuttx.bin nuttx
usage: esptool [-h] [--chip {auto,esp8266,esp32,esp32s2,esp32s3beta2,esp32s3,esp32c3,esp32c6beta,esp32h2beta1,esp32h2beta2,esp32c2}] [--port PORT] [--baud BAUD]
[--before {default_reset,usb_reset,no_reset,no_reset_no_sync}] [--after {hard_reset,soft_reset,no_reset,no_reset_stub}] [--no-stub] [--trace]
[--override-vddsdio [{1.8V,1.9V,OFF}]] [--connect-attempts CONNECT_ATTEMPTS]
{load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,merge_bin,get_security_info,version}
...
esptool: error: argument --chip/-c: invalid choice: 'esp32c6' (choose from 'auto', 'esp8266', 'esp32', 'esp32s2', 'esp32s3beta2', 'esp32s3', 'esp32c3', 'esp32c6beta', 'esp32h2beta1', 'esp32h2beta2', 'esp32c2')
make: *** [tools/Unix.mk:527: nuttx] Error 2 I think upgrade the esptool version to 4.5.1 should be able to fix this issue: |
@anchao Nice catch! I had only checked the |
Since the initial default setting in MSVC is text mode ( O_TEXT ): https://learn.microsoft.com/en-us/cpp/c-runtime-library/text-and-binary-mode-file-i-o?view=msvc-170 In order to unify the translation behavior with unix, 1. set O_BINARY for hostfs as default 2. enable default text mode if the application specifies flag O_TEXT Signed-off-by: chao an <anchao@xiaomi.com>
Summary
sim/hostfs: pass flag O_BINARY to host
Impact
N/A
Testing
sim/hostfs