You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/02/03 14:20:34 UTC
[GitHub] [incubator-nuttx] Ouss4 opened a new pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Ouss4 opened a new pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407
## Summary
QEMU had a different ROM image that used the regions of PRO CPU for both
CPUs. This was causing crashes when running SMP mode as the heap was
being corrupted when the APP CPU starts.
QEMU is now loading the same image as the hardware chip and thus this
special case doesn't exist anymore.
## Impact
ESP32 SMP in QEMU
## Testing
ESP32 boards.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029037772
cc. @masayuki2009 @yamt
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1039010781
@Ouss4 Thanks for you advice.
I just add config `CONFIG_ESP32_QEMU_IMAGE`
But now QEMU hang in `I (1703) boot: Disabling RNG early entropy source...`
```
zyl@zyl:~/nuttx$ qemu-system-xtensa -nographic \
> -machine esp32 -smp 2\
> -drive file=nuttx.merged.bin,if=mtd,format=raw
==882604==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6604
ho 0 tail 12 room 4
load:0x40078000,len:14780
load:0x40080400,len:3792
entry 0x40080694
I (1073) boot: ESP-IDF v4.4 2nd stage bootloader
I (1088) boot: compile time 19:32:08
I (1108) boot: chip revision: 0
I (1123) boot.esp32: SPI Speed : 40MHz
I (1125) boot.esp32: SPI Mode : DIO
I (1126) boot.esp32: SPI Flash Size : 4MB
I (1150) boot: Enabling RNG early entropy source...
I (1181) boot: Partition Table:
I (1182) boot: ## Label Usage Type ST Offset Length
I (1184) boot: 0 factory factory app 00 00 00010000 00100000
I (1201) boot: End of partition table
I (1219) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=01aa0h ( 6816) map
I (1277) esp_image: segment 1: paddr=00011ac8 vaddr=3ffb1310 size=000cch ( 204) load
I (1316) esp_image: segment 2: paddr=00011b9c vaddr=40080000 size=0174ch ( 5964) load
I (1378) esp_image: segment 3: paddr=000132f0 vaddr=00000000 size=0cd28h ( 52520)
I (1531) esp_image: segment 4: paddr=00020020 vaddr=400d0020 size=0f140h ( 61760) map
I (1699) boot: Loaded app from partition at offset 0x10000
I (1703) boot: Disabling RNG early entropy source...
```
No log at all after that and the Bash shell hang.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029474089
>QEMU is now loading the same image as the hardware chip and thus this
>special case doesn't exist anymore.
@Ouss4
Please update how to build the qemu and how to load the nuttx with the qemu?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1039010781
@Ouss4 Thanks for you advice.
I just add config `CONFIG_ESP32_QEMU_IMAGE`
But now QEMU hang in `I (1703) boot: Disabling RNG early entropy source...`
```
zyl@zyl:~/nuttx$ qemu-system-xtensa -nographic \
> -machine esp32 -smp 2\
> -drive file=nuttx.merged.bin,if=mtd,format=raw
==882604==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6604
ho 0 tail 12 room 4
load:0x40078000,len:14780
load:0x40080400,len:3792
entry 0x40080694
I (1073) boot: ESP-IDF v4.4 2nd stage bootloader
I (1088) boot: compile time 19:32:08
I (1108) boot: chip revision: 0
I (1123) boot.esp32: SPI Speed : 40MHz
I (1125) boot.esp32: SPI Mode : DIO
I (1126) boot.esp32: SPI Flash Size : 4MB
I (1150) boot: Enabling RNG early entropy source...
I (1181) boot: Partition Table:
I (1182) boot: ## Label Usage Type ST Offset Length
I (1184) boot: 0 factory factory app 00 00 00010000 00100000
I (1201) boot: End of partition table
I (1219) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=01aa0h ( 6816) map
I (1277) esp_image: segment 1: paddr=00011ac8 vaddr=3ffb1310 size=000cch ( 204) load
I (1316) esp_image: segment 2: paddr=00011b9c vaddr=40080000 size=0174ch ( 5964) load
I (1378) esp_image: segment 3: paddr=000132f0 vaddr=00000000 size=0cd28h ( 52520)
I (1531) esp_image: segment 4: paddr=00020020 vaddr=400d0020 size=0f140h ( 61760) map
I (1699) boot: Loaded app from partition at offset 0x10000
I (1703) boot: Disabling RNG early entropy source...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1039800932
@Ouss4 It's my mistake. qemu-system-xtensa work now. Thanks for you advice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
masayuki2009 edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029493261
>@masayuki2009 is nuttx.bin the flash image that includes all 3 binaries? There is also the option to generate the >nuttx.merged.bin for QEMU.
@Ouss4
No, because
>QEMU is now loading the same image as the hardware chip and thus this
>special case doesn't exist anymore.
I thought we can use the nuttx.bin for QEMU
Now I tried to load ./nuttx.merged.bin but it still fails.
$ ~/opensource/QEMU/qemu-esp-develop-20220203/build/qemu-system-xtensa -nographic -machine esp32 -smp 2 -drive file=./nuttx.merged.bin,if=mtd,format=raw
==31047==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
qemu-system-xtensa: Error: -bios argument not set, and ROM code binary not found (1)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1035857932
hi @Ouss4
I meet the same problem with masayuki2009 :
`
zyl@zyl:~/nuttx$ qemu-system-xtensa -nographic -machine esp32 -smp 2 -drive file=./nuttx.merged.bin,if=mtd,format=raw
==1476503==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
qemu-system-xtensa: failed to read the initial flash content
`
I'am sure I was use the latest version from : [https://github.com/espressif/qemu](https://github.com/espressif/qemu/tree/esp-develop/pc-bios)
Also I follow your answer and rebuild the qemu
But the result is same.
Could you give some advice with me?
`
./tools/configure.sh esp32:nsh
make -j64 ESPTOOL_BINDIR=/home/zyl/nuttx/esp32/
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029037772
cc. @masayuki2009 @yamt
Latest version of QEMU fixes this issue: https://github.com/espressif/qemu
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029478778
@Ouss4
Hmm, it does not work.
$ ~/opensource/QEMU/qemu-esp-develop-20220203/build/qemu-system-xtensa -nographic -machine esp32 -smp 2 -drive file=./nuttx.bin,if=mtd,format=raw
==27411==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
qemu-system-xtensa: failed to read the initial flash content
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029484959
@masayuki2009 is `nuttx.bin` the flash image that includes all 3 binaries? There is also the option to generate the `nuttx.merged.bin` for QEMU.
I just tried with both `eps32-devkitc:nsh` and `esp32-devkitc:smp`. Both work fine.
```
~/esp/qemu/build/qemu-system-xtensa -nographic \
-machine esp32 -smp 2\
-drive file=nuttx.merged.bin,if=mtd,format=raw
==29439==WARNING: ASan is ignoring requested __asan_handle_no_return: stack type: default top: 0x70000c171000; bottom 0x00011200a000; size: 0x6ffefa167000 (123140908150784)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
Adding SPI flash device
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6924
ho 0 tail 12 room 4
load:0x40078000,len:14308
load:0x40080400,len:3716
entry 0x40080680
I (1219) boot: ESP-IDF v4.3.1-29-ge493a4c30e 2nd stage bootloader
I (1237) boot: compile time 09:35:57
I (1259) boot: chip revision: 0
I (1283) boot.esp32: SPI Speed : 40MHz
I (1288) boot.esp32: SPI Mode : DIO
I (1290) boot.esp32: SPI Flash Size : 2MB
I (1328) boot: Enabling RNG early entropy source...
I (1371) boot: Partition Table:
I (1373) boot: ## Label Usage Type ST Offset Length
I (1378) boot: 0 factory factory app 00 00 00010000 00100000
I (1408) boot: End of partition table
I (1434) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=086a4h ( 34468) map
I (1706) esp_image: segment 1: paddr=000186cc vaddr=3ffb3ce0 size=000f0h ( 240) load
I (1758) esp_image: segment 2: paddr=000187c4 vaddr=40080000 size=01c58h ( 7256) load
I (1858) esp_image: segment 3: paddr=0001a424 vaddr=00000000 size=05bf4h ( 23540)
I (2045) esp_image: segment 4: paddr=00020020 vaddr=400d0020 size=16dach ( 93612) map
I (2734) boot: Loaded app from partition at offset 0x10000
I (2740) boot: Disabling RNG early entropy source...
NuttShell (NSH) NuttX-10.2.0
nsh> ps
PID GROUP CPU PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK USED FILLED COMMAND
0 0 0 0 FIFO Kthread N-- Assigned 00000000 003040 001088 35.7% CPU0 IDLE
1 1 1 0 FIFO Kthread N-- Running 00000000 003040 000032 1.0% CPU1 IDLE
2 2 0 100 RR Task --- Running 00000000 002000 001840 92.0%! nsh_main
nsh>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
masayuki2009 edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029500831
@Ouss4
>Do you have the latest version? Can you please ls /path/qemu/pc-bios, there should be:
Yes and I can find the files.
```
$ ls -l ~/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom*
-rwxrwxr-x 1 ishikawa ishikawa 455722 Feb 4 07:31 /home/ishikawa/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom-app.bin
-rwxrwxr-x 1 ishikawa ishikawa 455722 Feb 4 07:31 /home/ishikawa/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom.bin
```
```
~/opensource/QEMU/qemu-esp-develop-20220203/build/qemu-system-xtensa --version
==17602==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
QEMU emulator version 6.2.0 (v4.1.0-21153-g440ff71648)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1039075163
@zhuyanlinzyl NuttX seems to be loaded successfully but does not run for some reason. Can you please enable some debug output?
From my side I just tried `esp32-devkitc:nsh` and it's working.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1039010781
@Ouss4 Thanks for you advice.
I just add config `CONFIG_ESP32_QEMU_IMAGE`
But now QEMU hang in `I (1703) boot: Disabling RNG early entropy source...`
```
zyl@zyl:~/nuttx$ qemu-system-xtensa -nographic \
> -machine esp32 -smp 2\
> -drive file=nuttx.merged.bin,if=mtd,format=raw
==882604==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6604
ho 0 tail 12 room 4
load:0x40078000,len:14780
load:0x40080400,len:3792
entry 0x40080694
I (1073) boot: ESP-IDF v4.4 2nd stage bootloader
I (1088) boot: compile time 19:32:08
I (1108) boot: chip revision: 0
I (1123) boot.esp32: SPI Speed : 40MHz
I (1125) boot.esp32: SPI Mode : DIO
I (1126) boot.esp32: SPI Flash Size : 4MB
I (1150) boot: Enabling RNG early entropy source...
I (1181) boot: Partition Table:
I (1182) boot: ## Label Usage Type ST Offset Length
I (1184) boot: 0 factory factory app 00 00 00010000 00100000
I (1201) boot: End of partition table
I (1219) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=01aa0h ( 6816) map
I (1277) esp_image: segment 1: paddr=00011ac8 vaddr=3ffb1310 size=000cch ( 204) load
I (1316) esp_image: segment 2: paddr=00011b9c vaddr=40080000 size=0174ch ( 5964) load
I (1378) esp_image: segment 3: paddr=000132f0 vaddr=00000000 size=0cd28h ( 52520)
I (1531) esp_image: segment 4: paddr=00020020 vaddr=400d0020 size=0f140h ( 61760) map
I (1699) boot: Loaded app from partition at offset 0x10000
I (1703) boot: Disabling RNG early entropy source...
```
No log at all after that and Bash-shell hang.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029500831
@Ouss4
>Do you have the latest version? Can you please ls /path/qemu/pc-bios, there should be:
I can find the files.
```
$ ls -l ~/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom*
-rwxrwxr-x 1 ishikawa ishikawa 455722 Feb 4 07:31 /home/ishikawa/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom-app.bin
-rwxrwxr-x 1 ishikawa ishikawa 455722 Feb 4 07:31 /home/ishikawa/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom.bin
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1039800932
@Ouss4 It's my mistake. qemu-system-xtensa work now. Thanks for you advice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029037772
Latest version of QEMU fixes this issue: https://github.com/espressif/qemu
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] acassis merged pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
acassis merged pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029475308
> >QEMU is now loading the same image as the hardware chip and thus this
> >special case doesn't exist anymore.
>
> @Ouss4
> Please update how to build the qemu and how to load the nuttx with the qemu?
>
@masayuki2009 nothing changed on that regard. We just have to use the latest version of QEMU. Basically a git pull and rebuild again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029498412
> > @masayuki2009 is nuttx.bin the flash image that includes all 3 binaries? There is also the option to generate the >nuttx.merged.bin for QEMU.
>
> @Ouss4 No, because
>
> > QEMU is now loading the same image as the hardware chip and thus this
> > special case doesn't exist anymore.
>
> I thought we can use the nuttx.bin for QEMU
>
That was referencing the ROM code only. Now in QEMU we have two images for the ROM bootloader (one for each core), which is similar to the real hardware. Before this we were loading the PRO CPU's image for both cores.
As for `nuttx.merged.bin`, with the `CONFIG_ESP32_QEMU_IMAGE` option we create an image for the whole flash size, this is required by QEMU.
> Now I tried to load ./nuttx.merged.bin but it still fails.
> ...
> qemu-system-xtensa: Error: -bios argument not set, and ROM code binary not found (1)
Do you have the latest version? Can you please `ls /path/qemu/pc-bios`, there should be:
```
pc-bios/esp32-v3-rom-app.bin pc-bios/esp32-v3-rom.bin
```
You can see these files here: https://github.com/espressif/qemu/tree/esp-develop/pc-bios and the error you are getting is just a missing file:
https://github.com/espressif/qemu/blob/esp-develop/hw/xtensa/esp32.c#L799-L802
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1035857932
hi @Ouss4
I meet the same problem with masayuki2009 :
`
zyl@zyl:~/nuttx$ qemu-system-xtensa -nographic -machine esp32 -smp 2 -drive file=./nuttx.merged.bin,if=mtd,format=raw
==1476503==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
qemu-system-xtensa: failed to read the initial flash content
`
I'am sure I was use the latest version from : [https://github.com/espressif/qemu](https://github.com/espressif/qemu/tree/esp-develop/pc-bios)
Also I follow your answer and rebuild the qemu
But the result is same.
Can I check other place?
`
./tools/configure.sh esp32:nsh
make -j64 ESPTOOL_BINDIR=/home/zyl/nuttx/esp32/
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1035857932
hi @Ouss4
I meet the same problem with masayuki2009 :
`
zyl@zyl:~/nuttx$ qemu-system-xtensa -nographic -machine esp32 -smp 2 -drive file=./nuttx.merged.bin,if=mtd,format=raw
==1476503==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
qemu-system-xtensa: failed to read the initial flash content
`
I'am sure I was use the latest version from : [https://github.com/espressif/qemu](https://github.com/espressif/qemu/tree/esp-develop/pc-bios)
Also I follow your answer and rebuild the q emu
But the result is same.
Can I check other place?
`
./tools/configure.sh esp32:nsh
make -j64 ESPTOOL_BINDIR=/home/zyl/nuttx/esp32/
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1039010781
@Ouss4 Thanks for you advice.
I just add config `CONFIG_ESP32_QEMU_IMAGE`
But now qemu hang in `I (1703) boot: Disabling RNG early entropy source...`
```
zyl@zyl:~/nuttx$ qemu-system-xtensa -nographic \
> -machine esp32 -smp 2\
> -drive file=nuttx.merged.bin,if=mtd,format=raw
==882604==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6604
ho 0 tail 12 room 4
load:0x40078000,len:14780
load:0x40080400,len:3792
entry 0x40080694
I (1073) boot: ESP-IDF v4.4 2nd stage bootloader
I (1088) boot: compile time 19:32:08
I (1108) boot: chip revision: 0
I (1123) boot.esp32: SPI Speed : 40MHz
I (1125) boot.esp32: SPI Mode : DIO
I (1126) boot.esp32: SPI Flash Size : 4MB
I (1150) boot: Enabling RNG early entropy source...
I (1181) boot: Partition Table:
I (1182) boot: ## Label Usage Type ST Offset Length
I (1184) boot: 0 factory factory app 00 00 00010000 00100000
I (1201) boot: End of partition table
I (1219) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=01aa0h ( 6816) map
I (1277) esp_image: segment 1: paddr=00011ac8 vaddr=3ffb1310 size=000cch ( 204) load
I (1316) esp_image: segment 2: paddr=00011b9c vaddr=40080000 size=0174ch ( 5964) load
I (1378) esp_image: segment 3: paddr=000132f0 vaddr=00000000 size=0cd28h ( 52520)
I (1531) esp_image: segment 4: paddr=00020020 vaddr=400d0020 size=0f140h ( 61760) map
I (1699) boot: Loaded app from partition at offset 0x10000
I (1703) boot: Disabling RNG early entropy source...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1038959981
@zhuyanlinzyl sorry I just saw this comment.
Was the `CONFIG_ESP32_QEMU_IMAGE` enabled?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] zhuyanlinzyl commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
zhuyanlinzyl commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1039025653
@Ouss4
It's my qemu version and ubuntu version
```
zyl@zyl:~/nuttx$ qemu-system-xtensa --version
==883118==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
QEMU emulator version 6.2.0 (v4.1.0-21153-g440ff71648-dirty)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
```
```
zyl@zyl:~/nuttx$ cat /proc/version
Linux version 5.13.0-28-generic (buildd@lgw01-amd64-035) (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 edited a comment on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
masayuki2009 edited a comment on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029500831
@Ouss4
>Do you have the latest version? Can you please ls /path/qemu/pc-bios, there should be:
Yes and I can find the files.
```
$ ls -l ~/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom*
-rwxrwxr-x 1 ishikawa ishikawa 455722 Feb 4 07:31 /home/ishikawa/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom-app.bin
-rwxrwxr-x 1 ishikawa ishikawa 455722 Feb 4 07:31 /home/ishikawa/opensource/QEMU/qemu-esp-develop-20220203/pc-bios/esp32-v3-rom.bin
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029493261
>@masayuki2009 is nuttx.bin the flash image that includes all 3 binaries? There is also the option to generate the >nuttx.merged.bin for QEMU.
No, becaue
>QEMU is now loading the same image as the hardware chip and thus this
>special case doesn't exist anymore.
I thought we can use the nuttx.bin for QEMU
Now I tried to load ./nuttx.merged.bin but it still fails.
$ ~/opensource/QEMU/qemu-esp-develop-20220203/build/qemu-system-xtensa -nographic -machine esp32 -smp 2 -drive file=./nuttx.merged.bin,if=mtd,format=raw
==31047==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
qemu-system-xtensa: Error: -bios argument not set, and ROM code binary not found (1)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029513575
@Ouss4
Thanks, it works now!
```
$ ~/opensource/QEMU/qemu-esp-develop-20220203/build/qemu-system-xtensa -nographic -machine esp32 -smp 2 -drive file=./nuttx.merged.bin,if=mtd,format=raw
==21302==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6936
load:0x40078000,len:14356
load:0x40080400,len:3716
entry 0x40080680
I (1278) boot: ESP-IDF v4.3.1-245-gba15ac8634 2nd stage bootloader
I (1289) boot: compile time 18:01:38
I (1302) boot: chip revision: 0
I (1329) boot.esp32: SPI Speed : 40MHz
I (1331) boot.esp32: SPI Mode : DIO
I (1332) boot.esp32: SPI Flash Size : 4MB
I (1353) boot: Enabling RNG early entropy source...
I (1379) boot: Partition Table:
I (1380) boot: ## Label Usage Type ST Offset Length
I (1382) boot: 0 factory factory app 00 00 00010000 00100000
I (1425) boot: End of partition table
I (1443) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=086a8h ( 34472) map
I (1529) esp_image: segment 1: paddr=000186d0 vaddr=3ffb3ce0 size=000f0h ( 240) load
I (1567) esp_image: segment 2: paddr=000187c8 vaddr=40080000 size=01c58h ( 7256) load
I (1669) esp_image: segment 3: paddr=0001a428 vaddr=00000000 size=05bf0h ( 23536)
I (1783) esp_image: segment 4: paddr=00020020 vaddr=400d0020 size=16d9ch ( 93596) map
I (2059) boot: Loaded app from partition at offset 0x10000
I (2062) boot: Disabling RNG early entropy source...
NuttShell (NSH) NuttX-10.2.0
nsh> ps
PID GROUP CPU PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK USED FILLED COMMAND
0 0 0 0 FIFO Kthread N-- Assigned 00000000 003040 000976 32.1% CPU0 IDLE
1 1 1 0 FIFO Kthread N-- Running 00000000 003040 000032 1.0% CPU1 IDLE
2 2 0 100 RR Task --- Running 00000000 002000 001840 92.0%! nsh_main
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Ouss4 commented on pull request #5407: arch/xtensa/esp32: Remove the QEMU special case when initializing the heap.
Posted by GitBox <gi...@apache.org>.
Ouss4 commented on pull request #5407:
URL: https://github.com/apache/incubator-nuttx/pull/5407#issuecomment-1029508264
@masayuki2009 can you please rebuild again.
```
# To make sure submodules are updated after the last pull because the repo also got rebased on top of upstream 6.2.0
git submodule update
make distclean
./configure --target-list=xtensa-softmmu \
--enable-gcrypt \
--enable-debug --enable-sanitizers \
--disable-strip --disable-user \
--disable-capstone --disable-vnc \
--disable-sdl --disable-gtk
ninja -C build
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org