You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Tiago Medicci Serrano <ti...@gmail.com> on 2023/09/01 12:13:19 UTC

Re: Adding bluetooth configuration on esp32 hangs nsh

Hi Mike,

We have been using NuttX on ESP32 for a while. The `esp32-devkitc:blewifi`
is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS` and
`DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running it.

Again: please use the `esp32-devkitc:nxdiag` configuration and run the
`nxdiag -all` from the NSH (please refer to
https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag).
Please share your results for reevaluation ;)

Best regards,

Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
<nu...@mordent.com.invalid> escreveu:

> It appears that when using the blewifi configuration out of the box, and
> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION, and
> setting wifi ssid/pw causes the esp32 to hang.  This is as far as I've
> gotten so far.  I'm still tweaking other configs to see if they cause
> hanging as well.
>
> This just does NOT appear to be a stable OS on the ESP32.
>
> -m
>
> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
> > Hi!
> >
> > Good to know that! Yes, there are packages that need to be selected to
> make
> > it work. The `esp32-devkitc:blewifi` is a good starting point.
> >
> > Please note that BLE's log is enabled with the other wireless logs
> through
> > the menuconfig in "*Build Setup → Debug Options*". I hope this helps
> > debugging.
> >
> > Best regards,
> >
> > Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
> > <nu...@mordent.com.invalid> escreveu:
> >
> >> Hi,
> >>
> >> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps and
> >> ran tools/configure.sh with blewifi that I was able to get that
> >> configuration to work.  In my old tree, make distclean apparently didn't
> >> clean something, or my old tree was corrupt somehow.
> >>
> >> However, I still cannot get my own config to work (the one I previously
> >> attached).  There's a lot more stuff I need enabled than what is enabled
> >> by default in the blewifi configuration.  I guess I will just have to
> >> randomly keep modifying different config params until something works.
> >>
> >> Thanks,
> >> -m
> >>
> >> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
> >>> Hi Mike,
> >>>
> >>> I found no trouble using the esp32-devkitc:blewifi configuration. May I
> >> ask
> >>> you to double-check your bootloader/partition-table configuration? (you
> >> can
> >>> refer to
> >>>
> >>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
> >>> ).
> >>>
> >>> If not successful yet, please do the following:
> >>>
> >>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag -all`
> >>> from the NSH (please refer to
> >>>
> >>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
> >> ).
> >>> Please share your results for reevaluattion ;)
> >>>
> >>> Best regards,
> >>>
> >>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
> >>> tiago.medicci@gmail.com> escreveu:
> >>>
> >>>> Hi,
> >>>>
> >>>> I'll take a look at it soon. Interestingly, our internal CI tests all
> >> the
> >>>> defconfigs, so I wouldn't expect any erroneous behavior.
> >>>>
> >>>> I'll check.
> >>>>
> >>>> Best regards,
> >>>>
> >>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
> >>>> <nu...@mordent.com.invalid> escreveu:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
> >>>>>
> >>>>> If I try to configure NuttX via tools/configure.sh using the
> >>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I get
> >> problems
> >>>>> with it telling me there's no bootable app.
> >>>>>
> >>>>> If I instead start with the esp32-devkitc:nsh configuration and add
> >> wifi
> >>>>> and ble to it via menuconfig, I get only a little further.  It gets
> >> past
> >>>>> the entropy message and then I see "AB" and it hangs forever.  With
> >> all the
> >>>>> ble options disabled and only wifi configured by itself it actually
> >> boots
> >>>>> into nsh after some time.  (At first, I had a somewhat similar issue
> >> with
> >>>>> nsh when wifi only is enabled and connection info wasn't defined in
> the
> >>>>> config file, where it would seem to hang and then finally show a
> >> prompt.
> >>>>> It wasn't until I actually figured out about turning on CONFIG_DEBUG
> >>>>> "ERROR" for network/wireless that it showed me a bunch of errors
> during
> >>>>> boot and I knew it wasn't just hanging permanently and to just wait
> >> for it
> >>>>> a bit to show an nsh prompt.)
> >>>>>
> >>>>> However, there don't seem to be any config debug options for
> bluetooth.
> >>>>> I have no idea why it hangs as no messages are displayed and it never
> >> shows
> >>>>> a prompt even after a half an hour.  I've now spent hours messing
> with
> >>>>> various BLE configuration options with no luck.  I'm including my
> >> config
> >>>>> file in hope that someone might see something wrong with it.
> >>>>>
> >>>>> Thanks,
> >>>>> -m
> >>>>> --
> >>>>> Mike Moretti
> >>>>> ♩♫♫♩♪♩
> >>>>>
> >>>> --
> >>>> Tiago Medicci Serrano
> >>>>
> >>>> Embedded Software Engineer
> >>>> MSc Electronics/Microelectronics
> >>>> m: +55 (19) 981403886 <+55+(19)+981403886>
> >>>> e: tiago.medicci@gmail.com
> >>>> a: Campinas, Brazil
> >>>> Follow me:
> >>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
> >>>> <https://github.com/tmedicci>
> >>>>
> >>
>
>

-- 
Tiago Medicci Serrano

Embedded Software Engineer
MSc Electronics/Microelectronics
m: +55 (19) 981403886 <+55+(19)+981403886>
e: tiago.medicci@gmail.com
a: Campinas, Brazil
Follow me:
<https://www.linkedin.com/in/tiago-serrano-924458b6>
<https://github.com/tmedicci>

Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Petro Karashchenko <pe...@gmail.com>.
Hello Mike,

I've been experimenting with ESP32 BLE and WiFi some time ago. It didn't
work out of the box for me, but the main reason was that I used a different
chip version compared to the ones used in NuttX ESP32 configurations. One
of the reasons was the flash size and wifi related files placement. I my
case CONFIG_ESP32_WIFI_MTD_OFFSET was
0x280000 and CONFIG_ESP32_WIFI_MTD_SIZE was 0xb0000 and my ESP variant had
2Mb flash so 0x280000 was pointing to 2,5Mb and obviously lead to something
bad (actually I do not recall exactly what was happening). After I changed
CONFIG_ESP32_WIFI_MTD_OFFSET to 0x1f0000 and CONFIG_ESP32_WIFI_MTD_SIZE to
0x10000 things started to work.

The BLE with ESP32 in the current version of NuttX I think is not very
stable. I think that this is mostly due to the pretty old prebuilt version
of ESP-IDF used. I was trying to run nimBLE when I was prototyping
something and sometimes I was ending up with crash dump in "btController"
task (internal idf task) or slow reaction or device couldn't connect due to
"lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)" message (I even
now do not know what it means).

Currently I'm trying to build a commercial product based on ESP32-S3 and
recently BLE support was added. I'm pretty satisfied with ESP32-S3 till now
and the ESP-IDF version used for it in NuttX seems to be pretty fresh. For
now I'm developing a nimBLE based application on Linux and when I move
results to NuttX ESP32-S3 the application runs exactly the same as on Linux
(that was not true when I tried the same on EPS32). I hope that Espressif
will renew ESP32 in NuttX to the same level as currently ESP32-S3 is.

If you have some more specific questions, please do not hesitate to contact
me.

Best regards,
Petro

пт, 1 вер. 2023 р. о 23:32 Dmitri Shilov <ds...@cthru.xyz> пише:

> Hello Mike,
>
> I am a new developer, and new to NuttX. With my brief experience in the
> last few months, while it is true there are not as many features supported
> as you might want out of the box and the documentation is lacking at times,
> the strict adherence to guiding principles and consistent structure pays
> continuous cumulative dividends.
>
> Regarding the fit of NuttX for a project upfront, I will have to say that
> you'll never know that until you are implementing the specific things you
> need for your project. The difference I think will be once you inevitably
> encounter a missing feature, you'll be able to implement it yourself in
> NuttX a lot easier compared to asking for that feature from a different
> RTOS.
>
> Regards,
> Dmitri Shilov.
>
> -------- Original Message --------
> On Sept 1, 2023, 1:38 p.m., Mike Moretti < nuttx@mordent.com.INVALID>
> wrote:
> Hi, I totally get that NuttX is open source and community driven. For me,
> and a lot of people I know in the embedded device industry, whenever I have
> to choose an OS or framework or library for a device product, whether it's
> open source or commercial, depending on the kind of product (real product
> vs prototype/proof of concept) I have to look at the reliability/maturity
> of it as well as the feature set to know if it meets the product's needs. I
> wasn't around when my company made the choice to use NuttX, but now that
> I'm here, I'm worried that it will become my responsibility to support a
> product that runs on it (a real product that is supposed to be reliable),
> and that we are already months down the road developing with it, and as far
> as I know without really doing a good spike of up front work to validate it
> would meet the needs of the project both feature-wise and reliability-wise.
> The first thing I wanted to know is "how reliable is NuttX" on the platform
> we're using, the esp32. I googled "nuttx esp32", but didn't really find
> anything, not even a discussion forum or anything, just random people's
> blogs, and a one page doc of NuttX documentation about how to build it for
> the esp32 and what configurations there were. No stack overflow questions,
> no other forums, no discussion anywhere at all. I found that really really
> odd. Maybe I didn't search properly? Maybe I did not look hard enough, but
> I didn't easily find any info on reliability or how things get tested, etc,
> does the platform support esp32, and what features of esp32 does it support
> and what is the state of those, and what about the different drivers and
> other features of NuttX (spi, uart, i2c, networking, ble, etc), what's the
> state of those, etc? Then I found that the only place discussion seems to
> happen for NuttX is here on the dev mailing list. Somehow it's not
> searchable via google? Since I've started working on this project, I've run
> into problem after problem, either with configuration or building
> something, or something not working the way I think it's supposed to, or
> crashes/hangs (random spiffs crashes, weird random config param hanging),
> and I could never seem to find any discussion or even documentation about
> any of it online. I also had a really hard time finding the info I needed
> in the documentation for various things, especially for things like the
> options in menuconfig and the relations between these options with each
> other (the other biggest one being that ble is completely undocumented).
> I'm trying to keep an open mind, but I've seen other open source/community
> projects that seem to have better searchability/documentation/release info.
> We aren't throwing out NuttX yet. But somehow I'm going to have to figure
> out if we can actually use it and if it's going to be able to support all
> the stuff we need to do with it. If we continue to use it, it will probably
> turn out that we end up contributing some stuff back. Thanks, -m On
> 9/1/2023 1:47 PM, Tiago Medicci Serrano wrote: > Hi! > > Mike, NuttX is a
> community-driven project. There are a lot of ongoing > developments
> regarding CI testing, quality control and documentation > improvements.
> This job is mostly done by individual developers, although > there are some
> companies that help do that by keeping their own > infrastructure to test
> CI. > > Making automated testing scenarios with actual hardware is a big
> task and > we have been doing this lately to improve NuttX reliability.
> Making an > open-source, POSIX-compliant, operational system is a huge
> task! I hope you > can overcome your problems and help this amazing
> community! > > Please share your findings and help NuttX keeping improving
> ;) > > Best regards, > > Em sex., 1 de set. de 2023 às 14:33, Mike Moretti
> > escreveu: > >> 12.2.1 is an actual release. How did it pass testing and
> end up as an >> actual release? >> >> Unfortunately, all of this is leading
> me to believe that NuttX bluetooth >> support for esp32 is just not mature
> or production quality and probably >> should not be in any kind of actual
> "release" version of NuttX. There >> are no docs, and the latest actual
> release crashes in some random way >> when some random configs are present.
> It is also removing any >> confidence I have that NuttX in general is
> reliable as a whole. As it >> is, the current state of ble in NuttX is
> going to probably end up making >> us not able to continue to use NuttX. >>
> >> -m >> >> On 9/1/2023 1:16 PM, Tiago Medicci Serrano wrote: >>> Hi! >>>
> >>> Well, I was finally able to reproduce something similar to what you've
> >>> reported. When I switched to ` nuttx-12.2.1`, I was able to see the >>>
> NuttShell console indication but I wasn't able to type anything on it. >>>
> >>> Could you please get nuttx from git e build from master? >>> >>> I did
> the same and I applied the following patch to the `blewifi` >> defconfig:
> >>> ``` >>> diff --git
> a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig >>>
> b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig >>> index
> c988cbc1d7..bb4db27b14 100644 >>> ---
> a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig >>> +++
> b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig >>> @@ -6,7
> +6,6 @@ >>> # modifications. >>> # >>> # CONFIG_ARCH_LEDS is not set >>> -#
> CONFIG_NDEBUG is not set >>> # CONFIG_NSH_ARGCAT is not set >>> #
> CONFIG_NSH_CMDOPT_HEXDUMP is not set >>> CONFIG_ALLOW_BSD_COMPONENTS=y >>>
> @@ -25,6 +24,16 @@ CONFIG_BOARDCTL_RESET=y >>>
> CONFIG_BOARD_LOOPSPERMSEC=16717 >>> CONFIG_BTSAK=y >>> CONFIG_BUILTIN=y >>>
> +CONFIG_DEBUG_ASSERTIONS=y >>> +CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y >>>
> +CONFIG_DEBUG_ERROR=y >>> +CONFIG_DEBUG_FEATURES=y >>> +CONFIG_DEBUG_INFO=y
> >>> +CONFIG_DEBUG_WARN=y >>> +CONFIG_DEBUG_WIRELESS=y >>>
> +CONFIG_DEBUG_WIRELESS_ERROR=y >>> +CONFIG_DEBUG_WIRELESS_INFO=y >>>
> +CONFIG_DEBUG_WIRELESS_WARN=y >>> CONFIG_DEFAULT_TASK_STACKSIZE=4096 >>>
> CONFIG_DEV_URANDOM=y >>> CONFIG_DISABLE_MQUEUE_NOTIFICATION=y >>> @@ -32,6
> +41,7 @@ CONFIG_DRIVERS_BLUETOOTH=y >>> CONFIG_DRIVERS_IEEE80211=y >>>
> CONFIG_DRIVERS_WIRELESS=y >>> CONFIG_ESP32_BLE=y >>>
> +CONFIG_ESP32_MERGE_BINS=y >>> CONFIG_ESP32_RT_TIMER_TASK_STACK_SIZE=4096
> >>> CONFIG_ESP32_SPIFLASH=y >>> CONFIG_ESP32_SPIFLASH_SPIFFS=y >>> ``` >>>
> >>> `CONFIG_ESP32_MERGE_BINS` merges the bootloader and NuttX in a single
> >>> binary. Please download it from >>> >>
> https://drive.google.com/file/d/1poFsQpZ_SW7X_5FOHWYMVfAln3uBfO-S/view?usp=sharing
> >>> and try to flash it to your device (sha256: >>>
> 40bcb3817eb3a0458161e35a2d08bbd663d7c16b197cdebe0cfeaa2529e8a684) >>> >>>
> `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 erase_flash && esptool.py >>
> -c >>> esp32 -p /dev/ttyUSB0 -b 921600 write_flash -fs detect -fm dio 0x0
> >>> nuttx.merged.bin && minicom -D /dev/ttyUSB0` >>> >>> Tell me about your
> results. If it doesn't work, report me your console >>> results and run the
> following tests using the same `esptool.py`: >>> >>> `esptool.py -c esp32
> -p /dev/ttyUSB0 -b 921600 chip_id && esptool.py -c >>> esp32 -p
> /dev/ttyUSB0 -b 921600 flash_id` >>> >>> Best regards, >>> >>> Em sex., 1
> de set. de 2023 às 11:26, Lucas Vaz >>> escreveu: >>> >>>> The make
> bootloader command, by default, downloads the most recent >>>> pre-compiled
> binaries. Downloading them manually can still be done as >> long >>>> as
> you make sure you are grabbing the most recent version. You can also >>>>
> build it (or MCUboot) from source by changing the image configuration >>>>
> options in the menuconfig. >>>> >>>> Cheers, >>>> Lucas >>>>
> ________________________________ >>>> From: Mike Moretti >>>> Sent: Friday,
> September 1, 2023 11:14 >>>> To: dev@nuttx.apache.org >>>> Subject: Re:
> Adding bluetooth configuration on esp32 hangs nsh >>>> >>>> [External: This
> email originated outside Espressif] >>>> >>>> Wait, so you're telling me I
> should submit a PR, but you spent >>>> the time to document this on your
> own web site instead of submitting a >>>> PR to the official NuttX docs
> yourself? ;-) >>>> >>>> -m >>>> >>>> On 9/1/2023 10:02 AM, Alan C. Assis
> wrote: >>>>> Probably because we didn't update the documentation yet! :-)
> >>>>> >>>>> We're developers, we don't care about documentation... >>>>>
> documentation is for wimps! >>>>> >>>>> Of course we need to improve our
> documentation! This is why all new PR >>>>> introducing some new feature I
> insist to people include documentation. >>>>> >>>>> Please consider
> submitting a patch fixing it. >>>>> >>>>> BR, >>>>> >>>>> Alan >>>>> >>>>>
> On 9/1/23, Mike Moretti wrote: >>>>>> Wait, so, the NuttX docs say to just
> download the >> bootloader/partitions >>>>>> from some link. If we have to
> make the bootloader ourselves why isn't >>>>>> that part of the NuttX
> official documentation? >>>>>> >>>>>> -m >>>>>> >>>>>> On 9/1/2023 9:13 AM,
> Alan C. Assis wrote: >>>>>>> Hi Mike, >>>>>>> >>>>>>> Please sure you are
> using the right bootloader too: >>>>>>> >>>>>>> >>
> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
> >>>>>>> BR, >>>>>>> >>>>>>> Alan >>>>>>> >>>>>>> On 9/1/23, Mike Moretti
> wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> So, just to be sure, I made a
> completely fresh directory, untarred >> the >>>>>>>> 12.2.1 tarballs into
> it, did ./tools/configure.sh >>>> esp32-devkitc:blewifi, >>>>>>>> changed
> only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and >> then >>>>>>>>
> flashed. It boots to nsh but then doesn't accept any input; it's >>>> hung.
> >>>>>>>> If I have my wifi credentials in the config, so many messages come
> >>>> out I >>>>>>>> can't tell if it displayed the nsh prompt, but the last
> thing I see >>>>>>>> before it hangs and doesn't accept any input is some
> message about >>>> wifi >>>>>>>> (I'm assuming it connected). >>>>>>>>
> >>>>>>>> I then tried, after yet another rm+untar (yes, I'm removing both
> >> nuttx >>>>>>>> and apps and re-untarring them), to configure
> esp32-devkitc:nxdiag, >>>> but >>>>>>>> it wouldn't build. >>>>>>>>
> >>>>>>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04
> >>>> LTS) >>>>>>>> for other projects, I've just been use the toolchain
> that comes with >>>> it >>>>>>>> instead of the "latest" one recommend via
> the NuttX docs link. >>>>>>>> Unfortunately, it's a way older version of
> the gcc toolchain >> (gcc-8.4 >>>> vs >>>>>>>> gcc-12.2). >>>>>>>> >>>>>>>>
> So I installed the newer toolchain and esptool.py as directed by the
> >>>>>>>> NuttX documentation. I then opened a new shell without running the
> >>>>>>>> ESP-IDF environment setup script, manually set my path to include
> >> the >>>>>>>> new toolchain, and tried again. However, after yet another
> rm+untar >>>> and >>>>>>>> rebuilding blewifi + ASSERT configs with the
> newer toolchain, I >> still >>>>>>>> get the same problem with it hanging.
> >>>>>>>> >>>>>>>> But luckily, with the newer toolchain, I'm at least able
> to build >> and >>>>>>>> run nxdiag and here is the output: >>>>>>>>
> >>>>>>>> nxdiag --all >>>>>>>> Nxdiag Report: >>>>>>>> >>>>>>>> NuttX RTOS
> info: >>>>>>>> Hostname: >>>>>>>> Release: 12.2.1 >>>>>>>> Build:
> 148c631a2d Sep 1 2023 08:45:59 >>>>>>>> Arch: xtensa >>>>>>>> Defconfig:
> esp32-devkitc:nxdiag >>>>>>>> >>>>>>>> NuttX CFLAGS: >>>>>>>> -fno-common
> >>>>>>>> -Wall >>>>>>>> -Wstrict-prototypes >>>>>>>> -Wshadow >>>>>>>>
> -Wundef >>>>>>>> -Os >>>>>>>> -fno-strict-aliasing >>>>>>>>
> -fomit-frame-pointer >>>>>>>> -ffunction-sections >>>>>>>> -fdata-sections
> >>>>>>>> -mlongcalls >>>>>>>> -isystem
> /home/mmoretti/work/nuttx-12.2.1/nuttx/include >>>>>>>> -D__NuttX__
> >>>>>>>> -DNDEBUG >>>>>>>> -pipe >>>>>>>> -I
> "/home/mmoretti/work/nuttx-12.2.1/apps/include" >>>>>>>> >>>>>>>> NuttX
> CXXFLAGS: >>>>>>>> -fno-common >>>>>>>> -nostdinc++ >>>>>>>> -Wall >>>>>>>>
> -Wshadow >>>>>>>> -Wundef >>>>>>>> -std="gnu++17" >>>>>>>> -fno-exceptions
> >>>>>>>> -fcheck-new >>>>>>>> -fno-rtti >>>>>>>> -Os >>>>>>>>
> -fno-strict-aliasing >>>>>>>> -fomit-frame-pointer >>>>>>>>
> -ffunction-sections >>>>>>>> -fdata-sections >>>>>>>> -mlongcalls >>>>>>>>
> -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx >>>>>>>>
> -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include >>>>>>>>
> -D__NuttX__ >>>>>>>> -DNDEBUG >>>>>>>> -pipe >>>>>>>> -I
> "/home/mmoretti/work/nuttx-12.2.1/apps/include" >>>>>>>> >>>>>>>> NuttX
> LDFLAGS: >>>>>>>> -nostdlib >>>>>>>> --gc-sections >>>>>>>> --cref >>>>>>>>
> -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map >>>>>>>> >>>>>>>>
> NuttX configuration options: >>>>>>>> CONFIG_HOST_LINUX=y >>>>>>>>
> CONFIG_APPS_DIR="../apps" >>>>>>>>
> CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag" >>>>>>>> CONFIG_BUILD_FLAT=y
> >>>>>>>> CONFIG_INTELHEX_BINARY=y >>>>>>>> CONFIG_ARCH_HAVE_STDARG_H=y
> >>>>>>>> CONFIG_ARCH_HAVE_SETJMP=y >>>>>>>> CONFIG_ARCH_NONE_DEBUG_H=y
> >>>>>>>> CONFIG_FORTIFY_SOURCE=0 >>>>>>>> CONFIG_NDEBUG=y >>>>>>>>
> CONFIG_DEBUG_ALERT=y >>>>>>>> CONFIG_ARCH_HAVE_STACKCHECK=y >>>>>>>>
> CONFIG_ARCH_HAVE_CUSTOMOPT=y >>>>>>>> CONFIG_DEBUG_FULLOPT=y >>>>>>>>
> CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y >>>>>>>> CONFIG_DEBUG_LINK_MAP=y
> >>>>>>>> CONFIG_ARCH_XTENSA=y >>>>>>>> CONFIG_ARCH="xtensa" >>>>>>>>
> CONFIG_ARCH_CHIP="esp32" >>>>>>>> CONFIG_ARCH_BOARD="esp32-devkitc"
> >>>>>>>> CONFIG_ARCH_CHIP_ESP32=y >>>>>>>> CONFIG_ARCH_FAMILY_LX6=y
> >>>>>>>> CONFIG_XTENSA_CP_INITSET=0x0001 >>>>>>>>
> CONFIG_XTENSA_DUMPBT_ON_ASSERT=y >>>>>>>> CONFIG_XTENSA_BTDEPTH=50 >>>>>>>>
> CONFIG_XTENSA_TOOLCHAIN_ESP=y >>>>>>>> CONFIG_ARCH_CHIP_ESP32WROVER=y
> >>>>>>>> CONFIG_ESP32_DUAL_CPU=y >>>>>>>> CONFIG_ESP32_FLASH_4M=y >>>>>>>>
> CONFIG_ESP32_FLASH_DETECT=y >>>>>>>> CONFIG_ESP32_PSRAM_8M=y >>>>>>>>
> CONFIG_ESP32_ESP32DXWDXX=y >>>>>>>> CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
> >>>>>>>> CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 >>>>>>>>
> CONFIG_ESP32_XTAL_40MZ=y >>>>>>>> CONFIG_ESP32_UART=y >>>>>>>>
> CONFIG_ESP32_RTC=y >>>>>>>> CONFIG_ESP32_UART0=y >>>>>>>>
> CONFIG_ESP32_BT_RESERVE_DRAM=0 >>>>>>>>
> CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0 >>>>>>>>
> CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 >>>>>>>> CONFIG_ESP32_UART0_TXPIN=1
> >>>>>>>> CONFIG_ESP32_UART0_RXPIN=3 >>>>>>>> CONFIG_ESP32_FLASH_MODE_DIO=y
> >>>>>>>> CONFIG_ESP32_FLASH_FREQ_40M=y >>>>>>>>
> CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y >>>>>>>> CONFIG_ESP32_APP_FORMAT_LEGACY=y
> >>>>>>>> CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y >>>>>>>>
> CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000 >>>>>>>>
> CONFIG_ARCH_TOOLCHAIN_GNU=y >>>>>>>> CONFIG_LTO_NONE=y >>>>>>>>
> CONFIG_ARCH_VECNOTIRQ=y >>>>>>>> CONFIG_ARCH_HAVE_TEXT_HEAP=y >>>>>>>>
> CONFIG_ARCH_HAVE_MULTICPU=y >>>>>>>> CONFIG_ARCH_HAVE_FPU=y >>>>>>>>
> CONFIG_ARCH_HAVE_MPU=y >>>>>>>> CONFIG_ARCH_HAVE_RESET=y >>>>>>>>
> CONFIG_ARCH_HAVE_TESTSET=y >>>>>>>> CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
> >>>>>>>> CONFIG_ARCH_HAVE_BACKTRACE=y >>>>>>>>
> CONFIG_ARCH_HAVE_BOOTLOADER=y >>>>>>>> CONFIG_ARCH_HAVE_CPUINFO=y >>>>>>>>
> CONFIG_ARCH_FPU=y >>>>>>>> CONFIG_ARCH_STACKDUMP=y >>>>>>>>
> CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0 >>>>>>>> CONFIG_BOARD_LOOPSPERMSEC=16717
> >>>>>>>> CONFIG_ARCH_HAVE_INTERRUPTSTACK=y >>>>>>>>
> CONFIG_ARCH_INTERRUPTSTACK=0 >>>>>>>> CONFIG_BOOT_RUNFROMFLASH=y >>>>>>>>
> CONFIG_RAM_START=0x20000000 >>>>>>>> CONFIG_RAM_SIZE=114688 >>>>>>>>
> CONFIG_ARCH_BOARD_ESP32_DEVKITC=y >>>>>>>> CONFIG_ARCH_HAVE_LEDS=y >>>>>>>>
> CONFIG_ARCH_HAVE_BUTTONS=y >>>>>>>> CONFIG_ARCH_BOARD_COMMON=y >>>>>>>>
> CONFIG_BOARDCTL=y >>>>>>>> CONFIG_BOARDCTL_MKRD=y >>>>>>>>
> CONFIG_DISABLE_OS_API=y >>>>>>>> CONFIG_USEC_PER_TICK=10000 >>>>>>>>
> CONFIG_START_YEAR=2011 >>>>>>>> CONFIG_START_MONTH=12 >>>>>>>>
> CONFIG_START_DAY=6 >>>>>>>> CONFIG_PREALLOC_TIMERS=4 >>>>>>>>
> CONFIG_INIT_ENTRY=y >>>>>>>> CONFIG_INIT_ARGS="" >>>>>>>>
> CONFIG_INIT_STACKSIZE=2048 >>>>>>>> CONFIG_INIT_PRIORITY=100 >>>>>>>>
> CONFIG_INIT_ENTRYPOINT="nsh_main" >>>>>>>> CONFIG_INIT_ENTRYNAME="nsh_main"
> >>>>>>>> CONFIG_RR_INTERVAL=200 >>>>>>>> CONFIG_TASK_NAME_SIZE=31 >>>>>>>>
> CONFIG_SCHED_WAITPID=y >>>>>>>> CONFIG_PTHREAD_MUTEX_ROBUST=y >>>>>>>>
> CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y >>>>>>>>
> CONFIG_PTHREAD_CLEANUP_STACKSIZE=0 >>>>>>>> CONFIG_DEV_CONSOLE=y >>>>>>>>
> CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8 >>>>>>>> CONFIG_FILE_STREAM=y >>>>>>>>
> CONFIG_NAME_MAX=32 >>>>>>>> CONFIG_PATH_MAX=256 >>>>>>>>
> CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8 >>>>>>>> CONFIG_PREALLOC_MQ_MSGS=8
> >>>>>>>> CONFIG_PREALLOC_MQ_IRQ_MSGS=8 >>>>>>>> CONFIG_MQ_MAXMSGSIZE=32
> >>>>>>>> CONFIG_DEFAULT_TASK_STACKSIZE=2048 >>>>>>>>
> CONFIG_IDLETHREAD_STACKSIZE=3072 >>>>>>>> CONFIG_PTHREAD_STACK_MIN=256
> >>>>>>>> CONFIG_PTHREAD_STACK_DEFAULT=2048 >>>>>>>>
> CONFIG_ARCH_HAVE_I2CRESET=y >>>>>>>> CONFIG_DEV_NULL=y >>>>>>>>
> CONFIG_DRVR_MKRD=y >>>>>>>> CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y >>>>>>>>
> CONFIG_SERIAL=y >>>>>>>> CONFIG_SERIAL_CONSOLE=y >>>>>>>>
> CONFIG_MCU_SERIAL=y >>>>>>>> CONFIG_STANDARD_SERIAL=y >>>>>>>>
> CONFIG_SERIAL_NPOLLWAITERS=4 >>>>>>>> CONFIG_UART0_SERIAL_CONSOLE=y
> >>>>>>>> CONFIG_UART0_SERIALDRIVER=y >>>>>>>> CONFIG_UART0_RXBUFSIZE=256
> >>>>>>>> CONFIG_UART0_TXBUFSIZE=256 >>>>>>>> CONFIG_UART0_BAUD=115200
> >>>>>>>> CONFIG_UART0_BITS=8 >>>>>>>> CONFIG_UART0_PARITY=0 >>>>>>>>
> CONFIG_UART0_2STOP=0 >>>>>>>> CONFIG_SYSLOG_MAX_CHANNELS=1 >>>>>>>>
> CONFIG_SYSLOG_DEVPATH="/dev/ttyS1" >>>>>>>> CONFIG_SYSLOG_DEFAULT=y
> >>>>>>>> CONFIG_FS_NEPOLL_DESCRIPTORS=8 >>>>>>>>
> CONFIG_SENDFILE_BUFSIZE=512 >>>>>>>>
> CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue" >>>>>>>>
> CONFIG_FS_MQUEUE_NPOLLWAITERS=4 >>>>>>>> CONFIG_FS_ANONMAP=y >>>>>>>>
> CONFIG_FS_PROCFS=y >>>>>>>> CONFIG_FS_PROCFS_MAX_TASKS=128 >>>>>>>>
> CONFIG_NXFONTS_PACKEDMSFIRST=y >>>>>>>> CONFIG_MM_DEFAULT_MANAGER=y
> >>>>>>>> CONFIG_MM_DFAULT_ALIGNMENT=0 >>>>>>>> CONFIG_MM_REGIONS=3 >>>>>>>>
> CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0 >>>>>>>> CONFIG_MM_BACKTRACE=-1 >>>>>>>>
> CONFIG_STDIO_BUFFER_SIZE=64 >>>>>>>> CONFIG_STDIO_LINEBUFFER=y >>>>>>>>
> CONFIG_NUNGET_CHARS=2 >>>>>>>> CONFIG_LIBC_FLOATINGPOINT=y >>>>>>>>
> CONFIG_LIBC_LONG_LONG=y >>>>>>>> CONFIG_ARCH_LOWPUTC=y >>>>>>>>
> CONFIG_LIBC_ARCH_ATOMIC=y >>>>>>>> CONFIG_LIBC_ARCH_MEMCHR=y >>>>>>>>
> CONFIG_LIBC_ARCH_MEMCPY=y >>>>>>>> CONFIG_LIBC_ARCH_MEMCMP=y >>>>>>>>
> CONFIG_LIBC_ARCH_MEMMOVE=y >>>>>>>> CONFIG_LIBC_ARCH_MEMSET=y >>>>>>>>
> CONFIG_LIBC_ARCH_STRCHR=y >>>>>>>> CONFIG_LIBC_ARCH_STRCMP=y >>>>>>>>
> CONFIG_LIBC_ARCH_STRCPY=y >>>>>>>> CONFIG_LIBC_ARCH_STRLCPY=y >>>>>>>>
> CONFIG_LIBC_ARCH_STRNCPY=y >>>>>>>> CONFIG_LIBC_ARCH_STRLEN=y >>>>>>>>
> CONFIG_LIBC_ARCH_STRNLEN=y >>>>>>>> CONFIG_LIBC_PREVENT_STRING_KERNEL=y
> >>>>>>>> CONFIG_LIBC_RAND_ORDER=1 >>>>>>>> CONFIG_LIBC_HOMEDIR="/" >>>>>>>>
> CONFIG_LIBC_TMPDIR="/tmp" >>>>>>>> CONFIG_LIBC_MAX_TMPFILE=32 >>>>>>>>
> CONFIG_LIBC_MAX_EXITFUNS=0 >>>>>>>>
> CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048 >>>>>>>> CONFIG_LIBC_HOSTNAME=""
> >>>>>>>> CONFIG_LIBC_OPEN_MAX=256 >>>>>>>> CONFIG_LIBC_STRERROR_ERRNUM=y
> >>>>>>>> CONFIG_LIBC_STRSIGNAL=y >>>>>>>> CONFIG_TLS_NELEM=4 >>>>>>>>
> CONFIG_TLS_TASK_NELEM=0 >>>>>>>> CONFIG_LIBC_GAISTRERROR_ERRNUM=y >>>>>>>>
> CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok" >>>>>>>> CONFIG_LIBC_MEMFD_ERROR=y
> >>>>>>>> CONFIG_BUILTIN=y >>>>>>>> CONFIG_STREAM_OUT_BUFFER_SIZE=64
> >>>>>>>> CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128 >>>>>>>>
> CONFIG_LIBM_TOOLCHAIN=y >>>>>>>> CONFIG_HAVE_CXX=y >>>>>>>>
> CONFIG_HAVE_CXXINITIALIZE=y >>>>>>>> CONFIG_LIBCXXMINI=y >>>>>>>>
> CONFIG_CXX_STANDARD="gnu++17" >>>>>>>> CONFIG_NSH_LIBRARY=y >>>>>>>>
> CONFIG_NSH_PROMPT_STRING="nsh> " >>>>>>>> CONFIG_NSH_READLINE=y >>>>>>>>
> CONFIG_NSH_LINELEN=64 >>>>>>>> CONFIG_NSH_MAXARGUMENTS=7 >>>>>>>>
> CONFIG_NSH_NESTDEPTH=3 >>>>>>>> CONFIG_NSH_ALIAS=y >>>>>>>>
> CONFIG_NSH_ALIAS_MAX_AMOUNT=1 >>>>>>>> CONFIG_NSH_BUILTIN_APPS=y >>>>>>>>
> CONFIG_NSH_DISABLE_DATE=y >>>>>>>> CONFIG_NSH_DISABLE_LOSMART=y >>>>>>>>
> CONFIG_NSH_DISABLE_LOMTD=y >>>>>>>> CONFIG_NSH_DISABLE_MB=y >>>>>>>>
> CONFIG_NSH_DISABLE_MH=y >>>>>>>> CONFIG_NSH_DISABLE_MW=y >>>>>>>>
> CONFIG_NSH_DISABLE_TIMEDATECTL=y >>>>>>>> CONFIG_NSH_CODECS_BUFSIZE=128
> >>>>>>>> CONFIG_NSH_PROC_MOUNTPOINT="/proc" >>>>>>>>
> CONFIG_NSH_FILEIOSIZE=512 >>>>>>>> CONFIG_NSH_CONSOLE=y >>>>>>>>
> CONFIG_NSH_ARCHINIT=y >>>>>>>> CONFIG_SYSTEM_NSH=y >>>>>>>>
> CONFIG_SYSTEM_NSH_PRIORITY=100 >>>>>>>> CONFIG_SYSTEM_NSH_STACKSIZE=2048
> >>>>>>>> CONFIG_SYSTEM_NSH_PROGNAME="nsh" >>>>>>>> CONFIG_SYSTEM_NXDIAG=y
> >>>>>>>> CONFIG_SYSTEM_NXDIAG_PRIORITY=100 >>>>>>>>
> CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048 >>>>>>>> CONFIG_SYSTEM_NXDIAG_CONF=y
> >>>>>>>> CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y >>>>>>>>
> CONFIG_SYSTEM_NXDIAG_HOST_PATH=y >>>>>>>> CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
> >>>>>>>> CONFIG_SYSTEM_READLINE=y >>>>>>>> CONFIG_READLINE_HAVE_EXTMATCH=y
> >>>>>>>> CONFIG_READLINE_ECHO=y >>>>>>>> >>>>>>>> Host system OS: >>>>>>>>
> Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic >>>> #26~22.04.1-Ubuntu
> >>>>>>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
> >>>>>>>> >>>>>>>> Host system PATH: >>>>>>>>
> /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin >>>>>>>>
> /home/mmoretti/bin >>>>>>>> /home/mmoretti/tools/bin >>>>>>>>
> /home/mmoretti/bin >>>>>>>> /home/mmoretti/tools/bin >>>>>>>>
> /home/mmoretti/.local/bin >>>>>>>> /usr/local/sbin >>>>>>>> /usr/local/bin
> >>>>>>>> /usr/sbin >>>>>>>> /usr/bin >>>>>>>> /sbin >>>>>>>> /bin >>>>>>>>
> /usr/games >>>>>>>> /usr/local/games >>>>>>>> /snap/bin >>>>>>>> >>>>>>>>
> Espressif specific information: >>>>>>>> >>>>>>>> Bootloader version:
> >>>>>>>> esp32: v5.1-dev-3972-g1559b6309f >>>>>>>> esp32s2: Bootloader
> image not found >>>>>>>> esp32s3: Bootloader image not found >>>>>>>>
> esp32c2: Bootloader image not found >>>>>>>> esp32c3: Bootloader image not
> found >>>>>>>> esp32c6: Bootloader image not found >>>>>>>> esp32h2:
> Bootloader image not found >>>>>>>> >>>>>>>> Toolchain version: >>>>>>>>
> clang: Not found >>>>>>>> gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
> >>>>>>>> xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG >>>>>>>>
> esp-12.2.0_20230208) 12.2.0 >>>>>>>> xtensa-esp32s2-elf-gcc: Not found
> >>>>>>>> xtensa-esp32s3-elf-gcc: Not found >>>>>>>> riscv32-esp-elf-gcc:
> Not found >>>>>>>> riscv64-unknown-elf-gcc: Not found >>>>>>>> >>>>>>>>
> Esptool version: 4.6.2 >>>>>>>> >>>>>>>> nsh> >>>>>>>> >>>>>>>> >>>>>>>> -m
> >>>>>>>> >>>>>>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
> >>>>>>>>> Hi Mike, >>>>>>>>> >>>>>>>>> We have been using NuttX on ESP32
> for a while. The >>>>>>>>> `esp32-devkitc:blewifi` >>>>>>>>> is run by our
> internal pipeline (which sets the `DEBUG_ASSERTIONS` >>>> and >>>>>>>>>
> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running >>>> it.
> >>>>>>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and
> run >>>> the >>>>>>>>> `nxdiag -all` from the NSH (please refer to
> >>>>>>>>> >>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
> >>>> ). >>>>>>>>> Please share your results for reevaluation ;) >>>>>>>>>
> >>>>>>>>> Best regards, >>>>>>>>> >>>>>>>>> Em qui., 31 de ago. de 2023 às
> 14:00, Mike Moretti >>>>>>>>> escreveu: >>>>>>>>> >>>>>>>>>> It appears
> that when using the blewifi configuration out of the >> box, >>>>>>>>>> and
> >>>>>>>>>> just turning on DEBUG_ASSERTIONS and
> DEBUG_ASSERTIONS_EXPRESSION, >>>> and >>>>>>>>>> setting wifi ssid/pw
> causes the esp32 to hang. This is as far as >>>> I've >>>>>>>>>> gotten so
> far. I'm still tweaking other configs to see if they >>>> cause >>>>>>>>>>
> hanging as well. >>>>>>>>>> >>>>>>>>>> This just does NOT appear to be a
> stable OS on the ESP32. >>>>>>>>>> >>>>>>>>>> -m >>>>>>>>>> >>>>>>>>>> On
> 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote: >>>>>>>>>>> Hi! >>>>>>>>>>>
> >>>>>>>>>>> Good to know that! Yes, there are packages that need to be >>
> selected >>>>>>>>>>> to >>>>>>>>>> make >>>>>>>>>>> it work. The
> `esp32-devkitc:blewifi` is a good starting point. >>>>>>>>>>> >>>>>>>>>>>
> Please note that BLE's log is enabled with the other wireless >> logs
> >>>>>>>>>> through >>>>>>>>>>> the menuconfig in "*Build Setup → Debug
> Options*". I hope this >>>> helps >>>>>>>>>>> debugging. >>>>>>>>>>>
> >>>>>>>>>>> Best regards, >>>>>>>>>>> >>>>>>>>>>> Em qua., 30 de ago. de
> 2023 às 18:29, Mike Moretti >>>>>>>>>>> escreveu: >>>>>>>>>>> >>>>>>>>>>>>
> Hi, >>>>>>>>>>>> >>>>>>>>>>>> Thanks. It wasn't until I untarred a whole
> new copy of >> nuttx+apps >>>>>>>>>>>> and >>>>>>>>>>>> ran
> tools/configure.sh with blewifi that I was able to get that >>>>>>>>>>>>
> configuration to work. In my old tree, make distclean >> apparently
> >>>>>>>>>>>> didn't >>>>>>>>>>>> clean something, or my old tree was
> corrupt somehow. >>>>>>>>>>>> >>>>>>>>>>>> However, I still cannot get my
> own config to work (the one I >>>>>>>>>>>> previously >>>>>>>>>>>>
> attached). There's a lot more stuff I need enabled than what is
> >>>>>>>>>>>> enabled >>>>>>>>>>>> by default in the blewifi configuration.
> I guess I will just >> have >>>>>>>>>>>> to >>>>>>>>>>>> randomly keep
> modifying different config params until something >>>>>>>>>>>> works.
> >>>>>>>>>>>> >>>>>>>>>>>> Thanks, >>>>>>>>>>>> -m >>>>>>>>>>>> >>>>>>>>>>>>
> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote: >>>>>>>>>>>>> Hi Mike,
> >>>>>>>>>>>>> >>>>>>>>>>>>> I found no trouble using the
> esp32-devkitc:blewifi >> configuration. >>>>>>>>>>>>> May >>>>>>>>>>>>> I
> >>>>>>>>>>>> ask >>>>>>>>>>>>> you to double-check your
> bootloader/partition-table >>>> configuration? >>>>>>>>>>>>> (you
> >>>>>>>>>>>> can >>>>>>>>>>>>> refer to >>>>>>>>>>>>> >>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
> >>>>>>>>>>>>> ). >>>>>>>>>>>>> >>>>>>>>>>>>> If not successful yet, please
> do the following: >>>>>>>>>>>>> >>>>>>>>>>>>> Select the
> esp32-devkitc:nxdiag configuration and run the >> `nxdiag >>>>>>>>>>>>>
> -all` >>>>>>>>>>>>> from the NSH (please refer to >>>>>>>>>>>>> >>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
> >>>>>>>>>>>> ). >>>>>>>>>>>>> Please share your results for reevaluattion
> ;) >>>>>>>>>>>>> >>>>>>>>>>>>> Best regards, >>>>>>>>>>>>> >>>>>>>>>>>>> Em
> ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano < >>>>>>>>>>>>>
> tiago.medicci@gmail.com> escreveu: >>>>>>>>>>>>> >>>>>>>>>>>>>> Hi,
> >>>>>>>>>>>>>> >>>>>>>>>>>>>> I'll take a look at it soon. Interestingly,
> our internal CI >>>> tests >>>>>>>>>>>>>> all >>>>>>>>>>>> the
> >>>>>>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
> >>>>>>>>>>>>>> >>>>>>>>>>>>>> I'll check. >>>>>>>>>>>>>> >>>>>>>>>>>>>>
> Best regards, >>>>>>>>>>>>>> >>>>>>>>>>>>>> Em ter., 29 de ago. de 2023 às
> 16:38, Mike Moretti >>>>>>>>>>>>>> escreveu: >>>>>>>>>>>>>> >>>>>>>>>>>>>>>
> Hi, >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32
> wroom devkit. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> If I try to configure NuttX
> via tools/configure.sh using the >>>>>>>>>>>>>>> esp32-devkitc:blewifi
> configuration, when I boot the esp32, I >>>> get >>>>>>>>>>>> problems
> >>>>>>>>>>>>>>> with it telling me there's no bootable app. >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration
> >> and >>>>>>>>>>>>>>> add >>>>>>>>>>>> wifi >>>>>>>>>>>>>>> and ble to it
> via menuconfig, I get only a little further. >> It >>>>>>>>>>>>>>> gets
> >>>>>>>>>>>> past >>>>>>>>>>>>>>> the entropy message and then I see "AB"
> and it hangs forever. >>>>>>>>>>>>>>> With >>>>>>>>>>>> all the
> >>>>>>>>>>>>>>> ble options disabled and only wifi configured by itself it
> >>>>>>>>>>>>>>> actually >>>>>>>>>>>> boots >>>>>>>>>>>>>>> into nsh after
> some time. (At first, I had a somewhat >> similar >>>>>>>>>>>>>>> issue
> >>>>>>>>>>>> with >>>>>>>>>>>>>>> nsh when wifi only is enabled and
> connection info wasn't >>>> defined >>>>>>>>>>>>>>> in >>>>>>>>>> the
> >>>>>>>>>>>>>>> config file, where it would seem to hang and then finally
> >> show >>>> a >>>>>>>>>>>> prompt. >>>>>>>>>>>>>>> It wasn't until I
> actually figured out about turning on >>>>>>>>>>>>>>> CONFIG_DEBUG
> >>>>>>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of
> >>>> errors >>>>>>>>>> during >>>>>>>>>>>>>>> boot and I knew it wasn't
> just hanging permanently and to >> just >>>>>>>>>>>>>>> wait >>>>>>>>>>>>
> for it >>>>>>>>>>>>>>> a bit to show an nsh prompt.) >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> However, there don't seem to be any config debug options
> for >>>>>>>>>> bluetooth. >>>>>>>>>>>>>>> I have no idea why it hangs as no
> messages are displayed and >> it >>>>>>>>>>>>>>> never >>>>>>>>>>>> shows
> >>>>>>>>>>>>>>> a prompt even after a half an hour. I've now spent hours
> >>>> messing >>>>>>>>>> with >>>>>>>>>>>>>>> various BLE configuration
> options with no luck. I'm >> including >>>> my >>>>>>>>>>>> config
> >>>>>>>>>>>>>>> file in hope that someone might see something wrong with
> it. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Thanks, >>>>>>>>>>>>>>> -m
> >>>>>>>>>>>>>>> -- >>>>>>>>>>>>>>> Mike Moretti >>>>>>>>>>>>>>> ♩♫♫♩♪♩
> >>>>>>>>>>>>>>> >>>>>>>>>>>>>> -- >>>>>>>>>>>>>> Tiago Medicci Serrano
> >>>>>>>>>>>>>> >>>>>>>>>>>>>> Embedded Software Engineer >>>>>>>>>>>>>> MSc
> Electronics/Microelectronics >>>>>>>>>>>>>> m: +55 (19) 981403886
> >>>>>>>>>>>>>> e:tiago.medicci@gmail.com >>>>>>>>>>>>>> a: Campinas,
> Brazil >>>>>>>>>>>>>> Follow me: >>>>>>>>>>>>>> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> >>

Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Dmitri Shilov <ds...@cthru.xyz>.
Hello Mike,

I am a new developer, and new to NuttX. With my brief experience in the last few months, while it is true there are not as many features supported as you might want out of the box and the documentation is lacking at times, the strict adherence to guiding principles and consistent structure pays continuous cumulative dividends.

Regarding the fit of NuttX for a project upfront, I will have to say that you'll never know that until you are implementing the specific things you need for your project. The difference I think will be once you inevitably encounter a missing feature, you'll be able to implement it yourself in NuttX a lot easier compared to asking for that feature from a different RTOS.

Regards,
Dmitri Shilov.

-------- Original Message --------
On Sept 1, 2023, 1:38 p.m., Mike Moretti < nuttx@mordent.com.INVALID> wrote:
Hi, I totally get that NuttX is open source and community driven. For me, and a lot of people I know in the embedded device industry, whenever I have to choose an OS or framework or library for a device product, whether it's open source or commercial, depending on the kind of product (real product vs prototype/proof of concept) I have to look at the reliability/maturity of it as well as the feature set to know if it meets the product's needs. I wasn't around when my company made the choice to use NuttX, but now that I'm here, I'm worried that it will become my responsibility to support a product that runs on it (a real product that is supposed to be reliable), and that we are already months down the road developing with it, and as far as I know without really doing a good spike of up front work to validate it would meet the needs of the project both feature-wise and reliability-wise. The first thing I wanted to know is "how reliable is NuttX" on the platform we're using, the esp32. I googled "nuttx esp32", but didn't really find anything, not even a discussion forum or anything, just random people's blogs, and a one page doc of NuttX documentation about how to build it for the esp32 and what configurations there were. No stack overflow questions, no other forums, no discussion anywhere at all. I found that really really odd. Maybe I didn't search properly? Maybe I did not look hard enough, but I didn't easily find any info on reliability or how things get tested, etc, does the platform support esp32, and what features of esp32 does it support and what is the state of those, and what about the different drivers and other features of NuttX (spi, uart, i2c, networking, ble, etc), what's the state of those, etc? Then I found that the only place discussion seems to happen for NuttX is here on the dev mailing list. Somehow it's not searchable via google? Since I've started working on this project, I've run into problem after problem, either with configuration or building something, or something not working the way I think it's supposed to, or crashes/hangs (random spiffs crashes, weird random config param hanging), and I could never seem to find any discussion or even documentation about any of it online. I also had a really hard time finding the info I needed in the documentation for various things, especially for things like the options in menuconfig and the relations between these options with each other (the other biggest one being that ble is completely undocumented). I'm trying to keep an open mind, but I've seen other open source/community projects that seem to have better searchability/documentation/release info. We aren't throwing out NuttX yet. But somehow I'm going to have to figure out if we can actually use it and if it's going to be able to support all the stuff we need to do with it. If we continue to use it, it will probably turn out that we end up contributing some stuff back. Thanks, -m On 9/1/2023 1:47 PM, Tiago Medicci Serrano wrote: > Hi! > > Mike, NuttX is a community-driven project. There are a lot of ongoing > developments regarding CI testing, quality control and documentation > improvements. This job is mostly done by individual developers, although > there are some companies that help do that by keeping their own > infrastructure to test CI. > > Making automated testing scenarios with actual hardware is a big task and > we have been doing this lately to improve NuttX reliability. Making an > open-source, POSIX-compliant, operational system is a huge task! I hope you > can overcome your problems and help this amazing community! > > Please share your findings and help NuttX keeping improving ;) > > Best regards, > > Em sex., 1 de set. de 2023 às 14:33, Mike Moretti > escreveu: > >> 12.2.1 is an actual release. How did it pass testing and end up as an >> actual release? >> >> Unfortunately, all of this is leading me to believe that NuttX bluetooth >> support for esp32 is just not mature or production quality and probably >> should not be in any kind of actual "release" version of NuttX. There >> are no docs, and the latest actual release crashes in some random way >> when some random configs are present. It is also removing any >> confidence I have that NuttX in general is reliable as a whole. As it >> is, the current state of ble in NuttX is going to probably end up making >> us not able to continue to use NuttX. >> >> -m >> >> On 9/1/2023 1:16 PM, Tiago Medicci Serrano wrote: >>> Hi! >>> >>> Well, I was finally able to reproduce something similar to what you've >>> reported. When I switched to ` nuttx-12.2.1`, I was able to see the >>> NuttShell console indication but I wasn't able to type anything on it. >>> >>> Could you please get nuttx from git e build from master? >>> >>> I did the same and I applied the following patch to the `blewifi` >> defconfig: >>> ``` >>> diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig >>> b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig >>> index c988cbc1d7..bb4db27b14 100644 >>> --- a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig >>> +++ b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig >>> @@ -6,7 +6,6 @@ >>> # modifications. >>> # >>> # CONFIG_ARCH_LEDS is not set >>> -# CONFIG_NDEBUG is not set >>> # CONFIG_NSH_ARGCAT is not set >>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set >>> CONFIG_ALLOW_BSD_COMPONENTS=y >>> @@ -25,6 +24,16 @@ CONFIG_BOARDCTL_RESET=y >>> CONFIG_BOARD_LOOPSPERMSEC=16717 >>> CONFIG_BTSAK=y >>> CONFIG_BUILTIN=y >>> +CONFIG_DEBUG_ASSERTIONS=y >>> +CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y >>> +CONFIG_DEBUG_ERROR=y >>> +CONFIG_DEBUG_FEATURES=y >>> +CONFIG_DEBUG_INFO=y >>> +CONFIG_DEBUG_WARN=y >>> +CONFIG_DEBUG_WIRELESS=y >>> +CONFIG_DEBUG_WIRELESS_ERROR=y >>> +CONFIG_DEBUG_WIRELESS_INFO=y >>> +CONFIG_DEBUG_WIRELESS_WARN=y >>> CONFIG_DEFAULT_TASK_STACKSIZE=4096 >>> CONFIG_DEV_URANDOM=y >>> CONFIG_DISABLE_MQUEUE_NOTIFICATION=y >>> @@ -32,6 +41,7 @@ CONFIG_DRIVERS_BLUETOOTH=y >>> CONFIG_DRIVERS_IEEE80211=y >>> CONFIG_DRIVERS_WIRELESS=y >>> CONFIG_ESP32_BLE=y >>> +CONFIG_ESP32_MERGE_BINS=y >>> CONFIG_ESP32_RT_TIMER_TASK_STACK_SIZE=4096 >>> CONFIG_ESP32_SPIFLASH=y >>> CONFIG_ESP32_SPIFLASH_SPIFFS=y >>> ``` >>> >>> `CONFIG_ESP32_MERGE_BINS` merges the bootloader and NuttX in a single >>> binary. Please download it from >>> >> https://drive.google.com/file/d/1poFsQpZ_SW7X_5FOHWYMVfAln3uBfO-S/view?usp=sharing >>> and try to flash it to your device (sha256: >>> 40bcb3817eb3a0458161e35a2d08bbd663d7c16b197cdebe0cfeaa2529e8a684) >>> >>> `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 erase_flash && esptool.py >> -c >>> esp32 -p /dev/ttyUSB0 -b 921600 write_flash -fs detect -fm dio 0x0 >>> nuttx.merged.bin && minicom -D /dev/ttyUSB0` >>> >>> Tell me about your results. If it doesn't work, report me your console >>> results and run the following tests using the same `esptool.py`: >>> >>> `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 chip_id && esptool.py -c >>> esp32 -p /dev/ttyUSB0 -b 921600 flash_id` >>> >>> Best regards, >>> >>> Em sex., 1 de set. de 2023 às 11:26, Lucas Vaz >>> escreveu: >>> >>>> The make bootloader command, by default, downloads the most recent >>>> pre-compiled binaries. Downloading them manually can still be done as >> long >>>> as you make sure you are grabbing the most recent version. You can also >>>> build it (or MCUboot) from source by changing the image configuration >>>> options in the menuconfig. >>>> >>>> Cheers, >>>> Lucas >>>> ________________________________ >>>> From: Mike Moretti >>>> Sent: Friday, September 1, 2023 11:14 >>>> To: dev@nuttx.apache.org >>>> Subject: Re: Adding bluetooth configuration on esp32 hangs nsh >>>> >>>> [External: This email originated outside Espressif] >>>> >>>> Wait, so you're telling me I should submit a PR, but you spent >>>> the time to document this on your own web site instead of submitting a >>>> PR to the official NuttX docs yourself? ;-) >>>> >>>> -m >>>> >>>> On 9/1/2023 10:02 AM, Alan C. Assis wrote: >>>>> Probably because we didn't update the documentation yet! :-) >>>>> >>>>> We're developers, we don't care about documentation... >>>>> documentation is for wimps! >>>>> >>>>> Of course we need to improve our documentation! This is why all new PR >>>>> introducing some new feature I insist to people include documentation. >>>>> >>>>> Please consider submitting a patch fixing it. >>>>> >>>>> BR, >>>>> >>>>> Alan >>>>> >>>>> On 9/1/23, Mike Moretti wrote: >>>>>> Wait, so, the NuttX docs say to just download the >> bootloader/partitions >>>>>> from some link. If we have to make the bootloader ourselves why isn't >>>>>> that part of the NuttX official documentation? >>>>>> >>>>>> -m >>>>>> >>>>>> On 9/1/2023 9:13 AM, Alan C. Assis wrote: >>>>>>> Hi Mike, >>>>>>> >>>>>>> Please sure you are using the right bootloader too: >>>>>>> >>>>>>> >> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/ >>>>>>> BR, >>>>>>> >>>>>>> Alan >>>>>>> >>>>>>> On 9/1/23, Mike Moretti wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> So, just to be sure, I made a completely fresh directory, untarred >> the >>>>>>>> 12.2.1 tarballs into it, did ./tools/configure.sh >>>> esp32-devkitc:blewifi, >>>>>>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and >> then >>>>>>>> flashed. It boots to nsh but then doesn't accept any input; it's >>>> hung. >>>>>>>> If I have my wifi credentials in the config, so many messages come >>>> out I >>>>>>>> can't tell if it displayed the nsh prompt, but the last thing I see >>>>>>>> before it hangs and doesn't accept any input is some message about >>>> wifi >>>>>>>> (I'm assuming it connected). >>>>>>>> >>>>>>>> I then tried, after yet another rm+untar (yes, I'm removing both >> nuttx >>>>>>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag, >>>> but >>>>>>>> it wouldn't build. >>>>>>>> >>>>>>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04 >>>> LTS) >>>>>>>> for other projects, I've just been use the toolchain that comes with >>>> it >>>>>>>> instead of the "latest" one recommend via the NuttX docs link. >>>>>>>> Unfortunately, it's a way older version of the gcc toolchain >> (gcc-8.4 >>>> vs >>>>>>>> gcc-12.2). >>>>>>>> >>>>>>>> So I installed the newer toolchain and esptool.py as directed by the >>>>>>>> NuttX documentation. I then opened a new shell without running the >>>>>>>> ESP-IDF environment setup script, manually set my path to include >> the >>>>>>>> new toolchain, and tried again. However, after yet another rm+untar >>>> and >>>>>>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I >> still >>>>>>>> get the same problem with it hanging. >>>>>>>> >>>>>>>> But luckily, with the newer toolchain, I'm at least able to build >> and >>>>>>>> run nxdiag and here is the output: >>>>>>>> >>>>>>>> nxdiag --all >>>>>>>> Nxdiag Report: >>>>>>>> >>>>>>>> NuttX RTOS info: >>>>>>>> Hostname: >>>>>>>> Release: 12.2.1 >>>>>>>> Build: 148c631a2d Sep 1 2023 08:45:59 >>>>>>>> Arch: xtensa >>>>>>>> Defconfig: esp32-devkitc:nxdiag >>>>>>>> >>>>>>>> NuttX CFLAGS: >>>>>>>> -fno-common >>>>>>>> -Wall >>>>>>>> -Wstrict-prototypes >>>>>>>> -Wshadow >>>>>>>> -Wundef >>>>>>>> -Os >>>>>>>> -fno-strict-aliasing >>>>>>>> -fomit-frame-pointer >>>>>>>> -ffunction-sections >>>>>>>> -fdata-sections >>>>>>>> -mlongcalls >>>>>>>> -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include >>>>>>>> -D__NuttX__ >>>>>>>> -DNDEBUG >>>>>>>> -pipe >>>>>>>> -I "/home/mmoretti/work/nuttx-12.2.1/apps/include" >>>>>>>> >>>>>>>> NuttX CXXFLAGS: >>>>>>>> -fno-common >>>>>>>> -nostdinc++ >>>>>>>> -Wall >>>>>>>> -Wshadow >>>>>>>> -Wundef >>>>>>>> -std="gnu++17" >>>>>>>> -fno-exceptions >>>>>>>> -fcheck-new >>>>>>>> -fno-rtti >>>>>>>> -Os >>>>>>>> -fno-strict-aliasing >>>>>>>> -fomit-frame-pointer >>>>>>>> -ffunction-sections >>>>>>>> -fdata-sections >>>>>>>> -mlongcalls >>>>>>>> -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx >>>>>>>> -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include >>>>>>>> -D__NuttX__ >>>>>>>> -DNDEBUG >>>>>>>> -pipe >>>>>>>> -I "/home/mmoretti/work/nuttx-12.2.1/apps/include" >>>>>>>> >>>>>>>> NuttX LDFLAGS: >>>>>>>> -nostdlib >>>>>>>> --gc-sections >>>>>>>> --cref >>>>>>>> -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map >>>>>>>> >>>>>>>> NuttX configuration options: >>>>>>>> CONFIG_HOST_LINUX=y >>>>>>>> CONFIG_APPS_DIR="../apps" >>>>>>>> CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag" >>>>>>>> CONFIG_BUILD_FLAT=y >>>>>>>> CONFIG_INTELHEX_BINARY=y >>>>>>>> CONFIG_ARCH_HAVE_STDARG_H=y >>>>>>>> CONFIG_ARCH_HAVE_SETJMP=y >>>>>>>> CONFIG_ARCH_NONE_DEBUG_H=y >>>>>>>> CONFIG_FORTIFY_SOURCE=0 >>>>>>>> CONFIG_NDEBUG=y >>>>>>>> CONFIG_DEBUG_ALERT=y >>>>>>>> CONFIG_ARCH_HAVE_STACKCHECK=y >>>>>>>> CONFIG_ARCH_HAVE_CUSTOMOPT=y >>>>>>>> CONFIG_DEBUG_FULLOPT=y >>>>>>>> CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y >>>>>>>> CONFIG_DEBUG_LINK_MAP=y >>>>>>>> CONFIG_ARCH_XTENSA=y >>>>>>>> CONFIG_ARCH="xtensa" >>>>>>>> CONFIG_ARCH_CHIP="esp32" >>>>>>>> CONFIG_ARCH_BOARD="esp32-devkitc" >>>>>>>> CONFIG_ARCH_CHIP_ESP32=y >>>>>>>> CONFIG_ARCH_FAMILY_LX6=y >>>>>>>> CONFIG_XTENSA_CP_INITSET=0x0001 >>>>>>>> CONFIG_XTENSA_DUMPBT_ON_ASSERT=y >>>>>>>> CONFIG_XTENSA_BTDEPTH=50 >>>>>>>> CONFIG_XTENSA_TOOLCHAIN_ESP=y >>>>>>>> CONFIG_ARCH_CHIP_ESP32WROVER=y >>>>>>>> CONFIG_ESP32_DUAL_CPU=y >>>>>>>> CONFIG_ESP32_FLASH_4M=y >>>>>>>> CONFIG_ESP32_FLASH_DETECT=y >>>>>>>> CONFIG_ESP32_PSRAM_8M=y >>>>>>>> CONFIG_ESP32_ESP32DXWDXX=y >>>>>>>> CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y >>>>>>>> CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 >>>>>>>> CONFIG_ESP32_XTAL_40MZ=y >>>>>>>> CONFIG_ESP32_UART=y >>>>>>>> CONFIG_ESP32_RTC=y >>>>>>>> CONFIG_ESP32_UART0=y >>>>>>>> CONFIG_ESP32_BT_RESERVE_DRAM=0 >>>>>>>> CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0 >>>>>>>> CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 >>>>>>>> CONFIG_ESP32_UART0_TXPIN=1 >>>>>>>> CONFIG_ESP32_UART0_RXPIN=3 >>>>>>>> CONFIG_ESP32_FLASH_MODE_DIO=y >>>>>>>> CONFIG_ESP32_FLASH_FREQ_40M=y >>>>>>>> CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y >>>>>>>> CONFIG_ESP32_APP_FORMAT_LEGACY=y >>>>>>>> CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y >>>>>>>> CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000 >>>>>>>> CONFIG_ARCH_TOOLCHAIN_GNU=y >>>>>>>> CONFIG_LTO_NONE=y >>>>>>>> CONFIG_ARCH_VECNOTIRQ=y >>>>>>>> CONFIG_ARCH_HAVE_TEXT_HEAP=y >>>>>>>> CONFIG_ARCH_HAVE_MULTICPU=y >>>>>>>> CONFIG_ARCH_HAVE_FPU=y >>>>>>>> CONFIG_ARCH_HAVE_MPU=y >>>>>>>> CONFIG_ARCH_HAVE_RESET=y >>>>>>>> CONFIG_ARCH_HAVE_TESTSET=y >>>>>>>> CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y >>>>>>>> CONFIG_ARCH_HAVE_BACKTRACE=y >>>>>>>> CONFIG_ARCH_HAVE_BOOTLOADER=y >>>>>>>> CONFIG_ARCH_HAVE_CPUINFO=y >>>>>>>> CONFIG_ARCH_FPU=y >>>>>>>> CONFIG_ARCH_STACKDUMP=y >>>>>>>> CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0 >>>>>>>> CONFIG_BOARD_LOOPSPERMSEC=16717 >>>>>>>> CONFIG_ARCH_HAVE_INTERRUPTSTACK=y >>>>>>>> CONFIG_ARCH_INTERRUPTSTACK=0 >>>>>>>> CONFIG_BOOT_RUNFROMFLASH=y >>>>>>>> CONFIG_RAM_START=0x20000000 >>>>>>>> CONFIG_RAM_SIZE=114688 >>>>>>>> CONFIG_ARCH_BOARD_ESP32_DEVKITC=y >>>>>>>> CONFIG_ARCH_HAVE_LEDS=y >>>>>>>> CONFIG_ARCH_HAVE_BUTTONS=y >>>>>>>> CONFIG_ARCH_BOARD_COMMON=y >>>>>>>> CONFIG_BOARDCTL=y >>>>>>>> CONFIG_BOARDCTL_MKRD=y >>>>>>>> CONFIG_DISABLE_OS_API=y >>>>>>>> CONFIG_USEC_PER_TICK=10000 >>>>>>>> CONFIG_START_YEAR=2011 >>>>>>>> CONFIG_START_MONTH=12 >>>>>>>> CONFIG_START_DAY=6 >>>>>>>> CONFIG_PREALLOC_TIMERS=4 >>>>>>>> CONFIG_INIT_ENTRY=y >>>>>>>> CONFIG_INIT_ARGS="" >>>>>>>> CONFIG_INIT_STACKSIZE=2048 >>>>>>>> CONFIG_INIT_PRIORITY=100 >>>>>>>> CONFIG_INIT_ENTRYPOINT="nsh_main" >>>>>>>> CONFIG_INIT_ENTRYNAME="nsh_main" >>>>>>>> CONFIG_RR_INTERVAL=200 >>>>>>>> CONFIG_TASK_NAME_SIZE=31 >>>>>>>> CONFIG_SCHED_WAITPID=y >>>>>>>> CONFIG_PTHREAD_MUTEX_ROBUST=y >>>>>>>> CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y >>>>>>>> CONFIG_PTHREAD_CLEANUP_STACKSIZE=0 >>>>>>>> CONFIG_DEV_CONSOLE=y >>>>>>>> CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8 >>>>>>>> CONFIG_FILE_STREAM=y >>>>>>>> CONFIG_NAME_MAX=32 >>>>>>>> CONFIG_PATH_MAX=256 >>>>>>>> CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8 >>>>>>>> CONFIG_PREALLOC_MQ_MSGS=8 >>>>>>>> CONFIG_PREALLOC_MQ_IRQ_MSGS=8 >>>>>>>> CONFIG_MQ_MAXMSGSIZE=32 >>>>>>>> CONFIG_DEFAULT_TASK_STACKSIZE=2048 >>>>>>>> CONFIG_IDLETHREAD_STACKSIZE=3072 >>>>>>>> CONFIG_PTHREAD_STACK_MIN=256 >>>>>>>> CONFIG_PTHREAD_STACK_DEFAULT=2048 >>>>>>>> CONFIG_ARCH_HAVE_I2CRESET=y >>>>>>>> CONFIG_DEV_NULL=y >>>>>>>> CONFIG_DRVR_MKRD=y >>>>>>>> CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y >>>>>>>> CONFIG_SERIAL=y >>>>>>>> CONFIG_SERIAL_CONSOLE=y >>>>>>>> CONFIG_MCU_SERIAL=y >>>>>>>> CONFIG_STANDARD_SERIAL=y >>>>>>>> CONFIG_SERIAL_NPOLLWAITERS=4 >>>>>>>> CONFIG_UART0_SERIAL_CONSOLE=y >>>>>>>> CONFIG_UART0_SERIALDRIVER=y >>>>>>>> CONFIG_UART0_RXBUFSIZE=256 >>>>>>>> CONFIG_UART0_TXBUFSIZE=256 >>>>>>>> CONFIG_UART0_BAUD=115200 >>>>>>>> CONFIG_UART0_BITS=8 >>>>>>>> CONFIG_UART0_PARITY=0 >>>>>>>> CONFIG_UART0_2STOP=0 >>>>>>>> CONFIG_SYSLOG_MAX_CHANNELS=1 >>>>>>>> CONFIG_SYSLOG_DEVPATH="/dev/ttyS1" >>>>>>>> CONFIG_SYSLOG_DEFAULT=y >>>>>>>> CONFIG_FS_NEPOLL_DESCRIPTORS=8 >>>>>>>> CONFIG_SENDFILE_BUFSIZE=512 >>>>>>>> CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue" >>>>>>>> CONFIG_FS_MQUEUE_NPOLLWAITERS=4 >>>>>>>> CONFIG_FS_ANONMAP=y >>>>>>>> CONFIG_FS_PROCFS=y >>>>>>>> CONFIG_FS_PROCFS_MAX_TASKS=128 >>>>>>>> CONFIG_NXFONTS_PACKEDMSFIRST=y >>>>>>>> CONFIG_MM_DEFAULT_MANAGER=y >>>>>>>> CONFIG_MM_DFAULT_ALIGNMENT=0 >>>>>>>> CONFIG_MM_REGIONS=3 >>>>>>>> CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0 >>>>>>>> CONFIG_MM_BACKTRACE=-1 >>>>>>>> CONFIG_STDIO_BUFFER_SIZE=64 >>>>>>>> CONFIG_STDIO_LINEBUFFER=y >>>>>>>> CONFIG_NUNGET_CHARS=2 >>>>>>>> CONFIG_LIBC_FLOATINGPOINT=y >>>>>>>> CONFIG_LIBC_LONG_LONG=y >>>>>>>> CONFIG_ARCH_LOWPUTC=y >>>>>>>> CONFIG_LIBC_ARCH_ATOMIC=y >>>>>>>> CONFIG_LIBC_ARCH_MEMCHR=y >>>>>>>> CONFIG_LIBC_ARCH_MEMCPY=y >>>>>>>> CONFIG_LIBC_ARCH_MEMCMP=y >>>>>>>> CONFIG_LIBC_ARCH_MEMMOVE=y >>>>>>>> CONFIG_LIBC_ARCH_MEMSET=y >>>>>>>> CONFIG_LIBC_ARCH_STRCHR=y >>>>>>>> CONFIG_LIBC_ARCH_STRCMP=y >>>>>>>> CONFIG_LIBC_ARCH_STRCPY=y >>>>>>>> CONFIG_LIBC_ARCH_STRLCPY=y >>>>>>>> CONFIG_LIBC_ARCH_STRNCPY=y >>>>>>>> CONFIG_LIBC_ARCH_STRLEN=y >>>>>>>> CONFIG_LIBC_ARCH_STRNLEN=y >>>>>>>> CONFIG_LIBC_PREVENT_STRING_KERNEL=y >>>>>>>> CONFIG_LIBC_RAND_ORDER=1 >>>>>>>> CONFIG_LIBC_HOMEDIR="/" >>>>>>>> CONFIG_LIBC_TMPDIR="/tmp" >>>>>>>> CONFIG_LIBC_MAX_TMPFILE=32 >>>>>>>> CONFIG_LIBC_MAX_EXITFUNS=0 >>>>>>>> CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048 >>>>>>>> CONFIG_LIBC_HOSTNAME="" >>>>>>>> CONFIG_LIBC_OPEN_MAX=256 >>>>>>>> CONFIG_LIBC_STRERROR_ERRNUM=y >>>>>>>> CONFIG_LIBC_STRSIGNAL=y >>>>>>>> CONFIG_TLS_NELEM=4 >>>>>>>> CONFIG_TLS_TASK_NELEM=0 >>>>>>>> CONFIG_LIBC_GAISTRERROR_ERRNUM=y >>>>>>>> CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok" >>>>>>>> CONFIG_LIBC_MEMFD_ERROR=y >>>>>>>> CONFIG_BUILTIN=y >>>>>>>> CONFIG_STREAM_OUT_BUFFER_SIZE=64 >>>>>>>> CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128 >>>>>>>> CONFIG_LIBM_TOOLCHAIN=y >>>>>>>> CONFIG_HAVE_CXX=y >>>>>>>> CONFIG_HAVE_CXXINITIALIZE=y >>>>>>>> CONFIG_LIBCXXMINI=y >>>>>>>> CONFIG_CXX_STANDARD="gnu++17" >>>>>>>> CONFIG_NSH_LIBRARY=y >>>>>>>> CONFIG_NSH_PROMPT_STRING="nsh> " >>>>>>>> CONFIG_NSH_READLINE=y >>>>>>>> CONFIG_NSH_LINELEN=64 >>>>>>>> CONFIG_NSH_MAXARGUMENTS=7 >>>>>>>> CONFIG_NSH_NESTDEPTH=3 >>>>>>>> CONFIG_NSH_ALIAS=y >>>>>>>> CONFIG_NSH_ALIAS_MAX_AMOUNT=1 >>>>>>>> CONFIG_NSH_BUILTIN_APPS=y >>>>>>>> CONFIG_NSH_DISABLE_DATE=y >>>>>>>> CONFIG_NSH_DISABLE_LOSMART=y >>>>>>>> CONFIG_NSH_DISABLE_LOMTD=y >>>>>>>> CONFIG_NSH_DISABLE_MB=y >>>>>>>> CONFIG_NSH_DISABLE_MH=y >>>>>>>> CONFIG_NSH_DISABLE_MW=y >>>>>>>> CONFIG_NSH_DISABLE_TIMEDATECTL=y >>>>>>>> CONFIG_NSH_CODECS_BUFSIZE=128 >>>>>>>> CONFIG_NSH_PROC_MOUNTPOINT="/proc" >>>>>>>> CONFIG_NSH_FILEIOSIZE=512 >>>>>>>> CONFIG_NSH_CONSOLE=y >>>>>>>> CONFIG_NSH_ARCHINIT=y >>>>>>>> CONFIG_SYSTEM_NSH=y >>>>>>>> CONFIG_SYSTEM_NSH_PRIORITY=100 >>>>>>>> CONFIG_SYSTEM_NSH_STACKSIZE=2048 >>>>>>>> CONFIG_SYSTEM_NSH_PROGNAME="nsh" >>>>>>>> CONFIG_SYSTEM_NXDIAG=y >>>>>>>> CONFIG_SYSTEM_NXDIAG_PRIORITY=100 >>>>>>>> CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048 >>>>>>>> CONFIG_SYSTEM_NXDIAG_CONF=y >>>>>>>> CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y >>>>>>>> CONFIG_SYSTEM_NXDIAG_HOST_PATH=y >>>>>>>> CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y >>>>>>>> CONFIG_SYSTEM_READLINE=y >>>>>>>> CONFIG_READLINE_HAVE_EXTMATCH=y >>>>>>>> CONFIG_READLINE_ECHO=y >>>>>>>> >>>>>>>> Host system OS: >>>>>>>> Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic >>>> #26~22.04.1-Ubuntu >>>>>>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64 >>>>>>>> >>>>>>>> Host system PATH: >>>>>>>> /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin >>>>>>>> /home/mmoretti/bin >>>>>>>> /home/mmoretti/tools/bin >>>>>>>> /home/mmoretti/bin >>>>>>>> /home/mmoretti/tools/bin >>>>>>>> /home/mmoretti/.local/bin >>>>>>>> /usr/local/sbin >>>>>>>> /usr/local/bin >>>>>>>> /usr/sbin >>>>>>>> /usr/bin >>>>>>>> /sbin >>>>>>>> /bin >>>>>>>> /usr/games >>>>>>>> /usr/local/games >>>>>>>> /snap/bin >>>>>>>> >>>>>>>> Espressif specific information: >>>>>>>> >>>>>>>> Bootloader version: >>>>>>>> esp32: v5.1-dev-3972-g1559b6309f >>>>>>>> esp32s2: Bootloader image not found >>>>>>>> esp32s3: Bootloader image not found >>>>>>>> esp32c2: Bootloader image not found >>>>>>>> esp32c3: Bootloader image not found >>>>>>>> esp32c6: Bootloader image not found >>>>>>>> esp32h2: Bootloader image not found >>>>>>>> >>>>>>>> Toolchain version: >>>>>>>> clang: Not found >>>>>>>> gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 >>>>>>>> xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG >>>>>>>> esp-12.2.0_20230208) 12.2.0 >>>>>>>> xtensa-esp32s2-elf-gcc: Not found >>>>>>>> xtensa-esp32s3-elf-gcc: Not found >>>>>>>> riscv32-esp-elf-gcc: Not found >>>>>>>> riscv64-unknown-elf-gcc: Not found >>>>>>>> >>>>>>>> Esptool version: 4.6.2 >>>>>>>> >>>>>>>> nsh> >>>>>>>> >>>>>>>> >>>>>>>> -m >>>>>>>> >>>>>>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote: >>>>>>>>> Hi Mike, >>>>>>>>> >>>>>>>>> We have been using NuttX on ESP32 for a while. The >>>>>>>>> `esp32-devkitc:blewifi` >>>>>>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS` >>>> and >>>>>>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running >>>> it. >>>>>>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run >>>> the >>>>>>>>> `nxdiag -all` from the NSH (please refer to >>>>>>>>> >> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag >>>> ). >>>>>>>>> Please share your results for reevaluation ;) >>>>>>>>> >>>>>>>>> Best regards, >>>>>>>>> >>>>>>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti >>>>>>>>> escreveu: >>>>>>>>> >>>>>>>>>> It appears that when using the blewifi configuration out of the >> box, >>>>>>>>>> and >>>>>>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION, >>>> and >>>>>>>>>> setting wifi ssid/pw causes the esp32 to hang. This is as far as >>>> I've >>>>>>>>>> gotten so far. I'm still tweaking other configs to see if they >>>> cause >>>>>>>>>> hanging as well. >>>>>>>>>> >>>>>>>>>> This just does NOT appear to be a stable OS on the ESP32. >>>>>>>>>> >>>>>>>>>> -m >>>>>>>>>> >>>>>>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote: >>>>>>>>>>> Hi! >>>>>>>>>>> >>>>>>>>>>> Good to know that! Yes, there are packages that need to be >> selected >>>>>>>>>>> to >>>>>>>>>> make >>>>>>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point. >>>>>>>>>>> >>>>>>>>>>> Please note that BLE's log is enabled with the other wireless >> logs >>>>>>>>>> through >>>>>>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this >>>> helps >>>>>>>>>>> debugging. >>>>>>>>>>> >>>>>>>>>>> Best regards, >>>>>>>>>>> >>>>>>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti >>>>>>>>>>> escreveu: >>>>>>>>>>> >>>>>>>>>>>> Hi, >>>>>>>>>>>> >>>>>>>>>>>> Thanks. It wasn't until I untarred a whole new copy of >> nuttx+apps >>>>>>>>>>>> and >>>>>>>>>>>> ran tools/configure.sh with blewifi that I was able to get that >>>>>>>>>>>> configuration to work. In my old tree, make distclean >> apparently >>>>>>>>>>>> didn't >>>>>>>>>>>> clean something, or my old tree was corrupt somehow. >>>>>>>>>>>> >>>>>>>>>>>> However, I still cannot get my own config to work (the one I >>>>>>>>>>>> previously >>>>>>>>>>>> attached). There's a lot more stuff I need enabled than what is >>>>>>>>>>>> enabled >>>>>>>>>>>> by default in the blewifi configuration. I guess I will just >> have >>>>>>>>>>>> to >>>>>>>>>>>> randomly keep modifying different config params until something >>>>>>>>>>>> works. >>>>>>>>>>>> >>>>>>>>>>>> Thanks, >>>>>>>>>>>> -m >>>>>>>>>>>> >>>>>>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote: >>>>>>>>>>>>> Hi Mike, >>>>>>>>>>>>> >>>>>>>>>>>>> I found no trouble using the esp32-devkitc:blewifi >> configuration. >>>>>>>>>>>>> May >>>>>>>>>>>>> I >>>>>>>>>>>> ask >>>>>>>>>>>>> you to double-check your bootloader/partition-table >>>> configuration? >>>>>>>>>>>>> (you >>>>>>>>>>>> can >>>>>>>>>>>>> refer to >>>>>>>>>>>>> >> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions >>>>>>>>>>>>> ). >>>>>>>>>>>>> >>>>>>>>>>>>> If not successful yet, please do the following: >>>>>>>>>>>>> >>>>>>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the >> `nxdiag >>>>>>>>>>>>> -all` >>>>>>>>>>>>> from the NSH (please refer to >>>>>>>>>>>>> >> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag >>>>>>>>>>>> ). >>>>>>>>>>>>> Please share your results for reevaluattion ;) >>>>>>>>>>>>> >>>>>>>>>>>>> Best regards, >>>>>>>>>>>>> >>>>>>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano < >>>>>>>>>>>>> tiago.medicci@gmail.com> escreveu: >>>>>>>>>>>>> >>>>>>>>>>>>>> Hi, >>>>>>>>>>>>>> >>>>>>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI >>>> tests >>>>>>>>>>>>>> all >>>>>>>>>>>> the >>>>>>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior. >>>>>>>>>>>>>> >>>>>>>>>>>>>> I'll check. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Best regards, >>>>>>>>>>>>>> >>>>>>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti >>>>>>>>>>>>>> escreveu: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Hi, >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the >>>>>>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I >>>> get >>>>>>>>>>>> problems >>>>>>>>>>>>>>> with it telling me there's no bootable app. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration >> and >>>>>>>>>>>>>>> add >>>>>>>>>>>> wifi >>>>>>>>>>>>>>> and ble to it via menuconfig, I get only a little further. >> It >>>>>>>>>>>>>>> gets >>>>>>>>>>>> past >>>>>>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever. >>>>>>>>>>>>>>> With >>>>>>>>>>>> all the >>>>>>>>>>>>>>> ble options disabled and only wifi configured by itself it >>>>>>>>>>>>>>> actually >>>>>>>>>>>> boots >>>>>>>>>>>>>>> into nsh after some time. (At first, I had a somewhat >> similar >>>>>>>>>>>>>>> issue >>>>>>>>>>>> with >>>>>>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't >>>> defined >>>>>>>>>>>>>>> in >>>>>>>>>> the >>>>>>>>>>>>>>> config file, where it would seem to hang and then finally >> show >>>> a >>>>>>>>>>>> prompt. >>>>>>>>>>>>>>> It wasn't until I actually figured out about turning on >>>>>>>>>>>>>>> CONFIG_DEBUG >>>>>>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of >>>> errors >>>>>>>>>> during >>>>>>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to >> just >>>>>>>>>>>>>>> wait >>>>>>>>>>>> for it >>>>>>>>>>>>>>> a bit to show an nsh prompt.) >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> However, there don't seem to be any config debug options for >>>>>>>>>> bluetooth. >>>>>>>>>>>>>>> I have no idea why it hangs as no messages are displayed and >> it >>>>>>>>>>>>>>> never >>>>>>>>>>>> shows >>>>>>>>>>>>>>> a prompt even after a half an hour. I've now spent hours >>>> messing >>>>>>>>>> with >>>>>>>>>>>>>>> various BLE configuration options with no luck. I'm >> including >>>> my >>>>>>>>>>>> config >>>>>>>>>>>>>>> file in hope that someone might see something wrong with it. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Thanks, >>>>>>>>>>>>>>> -m >>>>>>>>>>>>>>> -- >>>>>>>>>>>>>>> Mike Moretti >>>>>>>>>>>>>>> ♩♫♫♩♪♩ >>>>>>>>>>>>>>> >>>>>>>>>>>>>> -- >>>>>>>>>>>>>> Tiago Medicci Serrano >>>>>>>>>>>>>> >>>>>>>>>>>>>> Embedded Software Engineer >>>>>>>>>>>>>> MSc Electronics/Microelectronics >>>>>>>>>>>>>> m: +55 (19) 981403886 >>>>>>>>>>>>>> e:tiago.medicci@gmail.com >>>>>>>>>>>>>> a: Campinas, Brazil >>>>>>>>>>>>>> Follow me: >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>

Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hahaha, true!

I use my blog as my personal reference!

I always feed my blog, but somethings I forget to update the
Documentation/ directory.

"Do as I say, not as I do!" ;-)

BR,

Alan

On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
> <irony>Wait, so you're telling me I should submit a PR, but you spent
> the time to document this on your own web site instead of submitting a
> PR to the official NuttX docs yourself?</irony> ;-)
>
> -m
>
> On 9/1/2023 10:02 AM, Alan C. Assis wrote:
>> Probably because we didn't update the documentation yet! :-)
>>
>> <irony> We're developers, we don't care about documentation...
>> documentation is for wimps! </irony>
>>
>> Of course we need to improve our documentation! This is why all new PR
>> introducing some new feature I insist to people include documentation.
>>
>> Please consider submitting a patch fixing it.
>>
>> BR,
>>
>> Alan
>>
>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>> Wait, so, the NuttX docs say to just download the bootloader/partitions
>>> from some link.  If we have to make the bootloader ourselves why isn't
>>> that part of the NuttX official documentation?
>>>
>>> -m
>>>
>>> On 9/1/2023 9:13 AM, Alan C. Assis wrote:
>>>> Hi Mike,
>>>>
>>>> Please sure you are using the right bootloader too:
>>>>
>>>> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
>>>>
>>>> BR,
>>>>
>>>> Alan
>>>>
>>>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>>>> Hi,
>>>>>
>>>>> So, just to be sure, I made a completely fresh directory, untarred the
>>>>> 12.2.1 tarballs into it, did ./tools/configure.sh
>>>>> esp32-devkitc:blewifi,
>>>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then
>>>>> flashed.  It boots to nsh but then doesn't accept any input; it's
>>>>> hung.
>>>>> If I have my wifi credentials in the config, so many messages come out
>>>>> I
>>>>> can't tell if it displayed the nsh prompt, but the last thing I see
>>>>> before it hangs and doesn't accept any input is some message about
>>>>> wifi
>>>>> (I'm assuming it connected).
>>>>>
>>>>> I then tried, after yet another rm+untar (yes, I'm removing both nuttx
>>>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag,
>>>>> but
>>>>> it wouldn't build.
>>>>>
>>>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04
>>>>> LTS)
>>>>> for other projects, I've just been use the toolchain that comes with
>>>>> it
>>>>> instead of the "latest" one recommend via the NuttX docs link.
>>>>> Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4
>>>>> vs
>>>>> gcc-12.2).
>>>>>
>>>>> So I installed the newer toolchain and esptool.py as directed by the
>>>>> NuttX documentation.  I then opened a new shell without running the
>>>>> ESP-IDF environment setup script, manually set my path to include the
>>>>> new toolchain, and tried again.  However, after yet another rm+untar
>>>>> and
>>>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I still
>>>>> get the same problem with it hanging.
>>>>>
>>>>> But luckily, with the newer toolchain, I'm at least able to build and
>>>>> run nxdiag and here is the output:
>>>>>
>>>>> nxdiag --all
>>>>> Nxdiag Report:
>>>>>
>>>>> NuttX RTOS info:
>>>>>        Hostname:
>>>>>        Release: 12.2.1
>>>>>        Build: 148c631a2d Sep  1 2023 08:45:59
>>>>>        Arch: xtensa
>>>>>        Defconfig: esp32-devkitc:nxdiag
>>>>>
>>>>> NuttX CFLAGS:
>>>>>        -fno-common
>>>>>        -Wall
>>>>>        -Wstrict-prototypes
>>>>>        -Wshadow
>>>>>        -Wundef
>>>>>        -Os
>>>>>        -fno-strict-aliasing
>>>>>        -fomit-frame-pointer
>>>>>        -ffunction-sections
>>>>>        -fdata-sections
>>>>>        -mlongcalls
>>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>>        -D__NuttX__
>>>>>        -DNDEBUG
>>>>>        -pipe
>>>>>        -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>>
>>>>> NuttX CXXFLAGS:
>>>>>        -fno-common
>>>>>        -nostdinc++
>>>>>        -Wall
>>>>>        -Wshadow
>>>>>        -Wundef
>>>>>        -std="gnu++17"
>>>>>        -fno-exceptions
>>>>>        -fcheck-new
>>>>>        -fno-rtti
>>>>>        -Os
>>>>>        -fno-strict-aliasing
>>>>>        -fomit-frame-pointer
>>>>>        -ffunction-sections
>>>>>        -fdata-sections
>>>>>        -mlongcalls
>>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
>>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>>        -D__NuttX__
>>>>>        -DNDEBUG
>>>>>        -pipe
>>>>>        -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>>
>>>>> NuttX LDFLAGS:
>>>>>        -nostdlib
>>>>>        --gc-sections
>>>>>        --cref
>>>>>        -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
>>>>>
>>>>> NuttX configuration options:
>>>>>        CONFIG_HOST_LINUX=y
>>>>>        CONFIG_APPS_DIR="../apps"
>>>>>        CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
>>>>>        CONFIG_BUILD_FLAT=y
>>>>>        CONFIG_INTELHEX_BINARY=y
>>>>>        CONFIG_ARCH_HAVE_STDARG_H=y
>>>>>        CONFIG_ARCH_HAVE_SETJMP=y
>>>>>        CONFIG_ARCH_NONE_DEBUG_H=y
>>>>>        CONFIG_FORTIFY_SOURCE=0
>>>>>        CONFIG_NDEBUG=y
>>>>>        CONFIG_DEBUG_ALERT=y
>>>>>        CONFIG_ARCH_HAVE_STACKCHECK=y
>>>>>        CONFIG_ARCH_HAVE_CUSTOMOPT=y
>>>>>        CONFIG_DEBUG_FULLOPT=y
>>>>>        CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
>>>>>        CONFIG_DEBUG_LINK_MAP=y
>>>>>        CONFIG_ARCH_XTENSA=y
>>>>>        CONFIG_ARCH="xtensa"
>>>>>        CONFIG_ARCH_CHIP="esp32"
>>>>>        CONFIG_ARCH_BOARD="esp32-devkitc"
>>>>>        CONFIG_ARCH_CHIP_ESP32=y
>>>>>        CONFIG_ARCH_FAMILY_LX6=y
>>>>>        CONFIG_XTENSA_CP_INITSET=0x0001
>>>>>        CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
>>>>>        CONFIG_XTENSA_BTDEPTH=50
>>>>>        CONFIG_XTENSA_TOOLCHAIN_ESP=y
>>>>>        CONFIG_ARCH_CHIP_ESP32WROVER=y
>>>>>        CONFIG_ESP32_DUAL_CPU=y
>>>>>        CONFIG_ESP32_FLASH_4M=y
>>>>>        CONFIG_ESP32_FLASH_DETECT=y
>>>>>        CONFIG_ESP32_PSRAM_8M=y
>>>>>        CONFIG_ESP32_ESP32DXWDXX=y
>>>>>        CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
>>>>>        CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
>>>>>        CONFIG_ESP32_XTAL_40MZ=y
>>>>>        CONFIG_ESP32_UART=y
>>>>>        CONFIG_ESP32_RTC=y
>>>>>        CONFIG_ESP32_UART0=y
>>>>>        CONFIG_ESP32_BT_RESERVE_DRAM=0
>>>>>        CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
>>>>>        CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
>>>>>        CONFIG_ESP32_UART0_TXPIN=1
>>>>>        CONFIG_ESP32_UART0_RXPIN=3
>>>>>        CONFIG_ESP32_FLASH_MODE_DIO=y
>>>>>        CONFIG_ESP32_FLASH_FREQ_40M=y
>>>>>        CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
>>>>>        CONFIG_ESP32_APP_FORMAT_LEGACY=y
>>>>>        CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
>>>>>        CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
>>>>>        CONFIG_ARCH_TOOLCHAIN_GNU=y
>>>>>        CONFIG_LTO_NONE=y
>>>>>        CONFIG_ARCH_VECNOTIRQ=y
>>>>>        CONFIG_ARCH_HAVE_TEXT_HEAP=y
>>>>>        CONFIG_ARCH_HAVE_MULTICPU=y
>>>>>        CONFIG_ARCH_HAVE_FPU=y
>>>>>        CONFIG_ARCH_HAVE_MPU=y
>>>>>        CONFIG_ARCH_HAVE_RESET=y
>>>>>        CONFIG_ARCH_HAVE_TESTSET=y
>>>>>        CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
>>>>>        CONFIG_ARCH_HAVE_BACKTRACE=y
>>>>>        CONFIG_ARCH_HAVE_BOOTLOADER=y
>>>>>        CONFIG_ARCH_HAVE_CPUINFO=y
>>>>>        CONFIG_ARCH_FPU=y
>>>>>        CONFIG_ARCH_STACKDUMP=y
>>>>>        CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
>>>>>        CONFIG_BOARD_LOOPSPERMSEC=16717
>>>>>        CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
>>>>>        CONFIG_ARCH_INTERRUPTSTACK=0
>>>>>        CONFIG_BOOT_RUNFROMFLASH=y
>>>>>        CONFIG_RAM_START=0x20000000
>>>>>        CONFIG_RAM_SIZE=114688
>>>>>        CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
>>>>>        CONFIG_ARCH_HAVE_LEDS=y
>>>>>        CONFIG_ARCH_HAVE_BUTTONS=y
>>>>>        CONFIG_ARCH_BOARD_COMMON=y
>>>>>        CONFIG_BOARDCTL=y
>>>>>        CONFIG_BOARDCTL_MKRD=y
>>>>>        CONFIG_DISABLE_OS_API=y
>>>>>        CONFIG_USEC_PER_TICK=10000
>>>>>        CONFIG_START_YEAR=2011
>>>>>        CONFIG_START_MONTH=12
>>>>>        CONFIG_START_DAY=6
>>>>>        CONFIG_PREALLOC_TIMERS=4
>>>>>        CONFIG_INIT_ENTRY=y
>>>>>        CONFIG_INIT_ARGS=""
>>>>>        CONFIG_INIT_STACKSIZE=2048
>>>>>        CONFIG_INIT_PRIORITY=100
>>>>>        CONFIG_INIT_ENTRYPOINT="nsh_main"
>>>>>        CONFIG_INIT_ENTRYNAME="nsh_main"
>>>>>        CONFIG_RR_INTERVAL=200
>>>>>        CONFIG_TASK_NAME_SIZE=31
>>>>>        CONFIG_SCHED_WAITPID=y
>>>>>        CONFIG_PTHREAD_MUTEX_ROBUST=y
>>>>>        CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
>>>>>        CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
>>>>>        CONFIG_DEV_CONSOLE=y
>>>>>        CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
>>>>>        CONFIG_FILE_STREAM=y
>>>>>        CONFIG_NAME_MAX=32
>>>>>        CONFIG_PATH_MAX=256
>>>>>        CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
>>>>>        CONFIG_PREALLOC_MQ_MSGS=8
>>>>>        CONFIG_PREALLOC_MQ_IRQ_MSGS=8
>>>>>        CONFIG_MQ_MAXMSGSIZE=32
>>>>>        CONFIG_DEFAULT_TASK_STACKSIZE=2048
>>>>>        CONFIG_IDLETHREAD_STACKSIZE=3072
>>>>>        CONFIG_PTHREAD_STACK_MIN=256
>>>>>        CONFIG_PTHREAD_STACK_DEFAULT=2048
>>>>>        CONFIG_ARCH_HAVE_I2CRESET=y
>>>>>        CONFIG_DEV_NULL=y
>>>>>        CONFIG_DRVR_MKRD=y
>>>>>        CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
>>>>>        CONFIG_SERIAL=y
>>>>>        CONFIG_SERIAL_CONSOLE=y
>>>>>        CONFIG_MCU_SERIAL=y
>>>>>        CONFIG_STANDARD_SERIAL=y
>>>>>        CONFIG_SERIAL_NPOLLWAITERS=4
>>>>>        CONFIG_UART0_SERIAL_CONSOLE=y
>>>>>        CONFIG_UART0_SERIALDRIVER=y
>>>>>        CONFIG_UART0_RXBUFSIZE=256
>>>>>        CONFIG_UART0_TXBUFSIZE=256
>>>>>        CONFIG_UART0_BAUD=115200
>>>>>        CONFIG_UART0_BITS=8
>>>>>        CONFIG_UART0_PARITY=0
>>>>>        CONFIG_UART0_2STOP=0
>>>>>        CONFIG_SYSLOG_MAX_CHANNELS=1
>>>>>        CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
>>>>>        CONFIG_SYSLOG_DEFAULT=y
>>>>>        CONFIG_FS_NEPOLL_DESCRIPTORS=8
>>>>>        CONFIG_SENDFILE_BUFSIZE=512
>>>>>        CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
>>>>>        CONFIG_FS_MQUEUE_NPOLLWAITERS=4
>>>>>        CONFIG_FS_ANONMAP=y
>>>>>        CONFIG_FS_PROCFS=y
>>>>>        CONFIG_FS_PROCFS_MAX_TASKS=128
>>>>>        CONFIG_NXFONTS_PACKEDMSFIRST=y
>>>>>        CONFIG_MM_DEFAULT_MANAGER=y
>>>>>        CONFIG_MM_DFAULT_ALIGNMENT=0
>>>>>        CONFIG_MM_REGIONS=3
>>>>>        CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
>>>>>        CONFIG_MM_BACKTRACE=-1
>>>>>        CONFIG_STDIO_BUFFER_SIZE=64
>>>>>        CONFIG_STDIO_LINEBUFFER=y
>>>>>        CONFIG_NUNGET_CHARS=2
>>>>>        CONFIG_LIBC_FLOATINGPOINT=y
>>>>>        CONFIG_LIBC_LONG_LONG=y
>>>>>        CONFIG_ARCH_LOWPUTC=y
>>>>>        CONFIG_LIBC_ARCH_ATOMIC=y
>>>>>        CONFIG_LIBC_ARCH_MEMCHR=y
>>>>>        CONFIG_LIBC_ARCH_MEMCPY=y
>>>>>        CONFIG_LIBC_ARCH_MEMCMP=y
>>>>>        CONFIG_LIBC_ARCH_MEMMOVE=y
>>>>>        CONFIG_LIBC_ARCH_MEMSET=y
>>>>>        CONFIG_LIBC_ARCH_STRCHR=y
>>>>>        CONFIG_LIBC_ARCH_STRCMP=y
>>>>>        CONFIG_LIBC_ARCH_STRCPY=y
>>>>>        CONFIG_LIBC_ARCH_STRLCPY=y
>>>>>        CONFIG_LIBC_ARCH_STRNCPY=y
>>>>>        CONFIG_LIBC_ARCH_STRLEN=y
>>>>>        CONFIG_LIBC_ARCH_STRNLEN=y
>>>>>        CONFIG_LIBC_PREVENT_STRING_KERNEL=y
>>>>>        CONFIG_LIBC_RAND_ORDER=1
>>>>>        CONFIG_LIBC_HOMEDIR="/"
>>>>>        CONFIG_LIBC_TMPDIR="/tmp"
>>>>>        CONFIG_LIBC_MAX_TMPFILE=32
>>>>>        CONFIG_LIBC_MAX_EXITFUNS=0
>>>>>        CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
>>>>>        CONFIG_LIBC_HOSTNAME=""
>>>>>        CONFIG_LIBC_OPEN_MAX=256
>>>>>        CONFIG_LIBC_STRERROR_ERRNUM=y
>>>>>        CONFIG_LIBC_STRSIGNAL=y
>>>>>        CONFIG_TLS_NELEM=4
>>>>>        CONFIG_TLS_TASK_NELEM=0
>>>>>        CONFIG_LIBC_GAISTRERROR_ERRNUM=y
>>>>>        CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
>>>>>        CONFIG_LIBC_MEMFD_ERROR=y
>>>>>        CONFIG_BUILTIN=y
>>>>>        CONFIG_STREAM_OUT_BUFFER_SIZE=64
>>>>>        CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
>>>>>        CONFIG_LIBM_TOOLCHAIN=y
>>>>>        CONFIG_HAVE_CXX=y
>>>>>        CONFIG_HAVE_CXXINITIALIZE=y
>>>>>        CONFIG_LIBCXXMINI=y
>>>>>        CONFIG_CXX_STANDARD="gnu++17"
>>>>>        CONFIG_NSH_LIBRARY=y
>>>>>        CONFIG_NSH_PROMPT_STRING="nsh> "
>>>>>        CONFIG_NSH_READLINE=y
>>>>>        CONFIG_NSH_LINELEN=64
>>>>>        CONFIG_NSH_MAXARGUMENTS=7
>>>>>        CONFIG_NSH_NESTDEPTH=3
>>>>>        CONFIG_NSH_ALIAS=y
>>>>>        CONFIG_NSH_ALIAS_MAX_AMOUNT=1
>>>>>        CONFIG_NSH_BUILTIN_APPS=y
>>>>>        CONFIG_NSH_DISABLE_DATE=y
>>>>>        CONFIG_NSH_DISABLE_LOSMART=y
>>>>>        CONFIG_NSH_DISABLE_LOMTD=y
>>>>>        CONFIG_NSH_DISABLE_MB=y
>>>>>        CONFIG_NSH_DISABLE_MH=y
>>>>>        CONFIG_NSH_DISABLE_MW=y
>>>>>        CONFIG_NSH_DISABLE_TIMEDATECTL=y
>>>>>        CONFIG_NSH_CODECS_BUFSIZE=128
>>>>>        CONFIG_NSH_PROC_MOUNTPOINT="/proc"
>>>>>        CONFIG_NSH_FILEIOSIZE=512
>>>>>        CONFIG_NSH_CONSOLE=y
>>>>>        CONFIG_NSH_ARCHINIT=y
>>>>>        CONFIG_SYSTEM_NSH=y
>>>>>        CONFIG_SYSTEM_NSH_PRIORITY=100
>>>>>        CONFIG_SYSTEM_NSH_STACKSIZE=2048
>>>>>        CONFIG_SYSTEM_NSH_PROGNAME="nsh"
>>>>>        CONFIG_SYSTEM_NXDIAG=y
>>>>>        CONFIG_SYSTEM_NXDIAG_PRIORITY=100
>>>>>        CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
>>>>>        CONFIG_SYSTEM_NXDIAG_CONF=y
>>>>>        CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
>>>>>        CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
>>>>>        CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
>>>>>        CONFIG_SYSTEM_READLINE=y
>>>>>        CONFIG_READLINE_HAVE_EXTMATCH=y
>>>>>        CONFIG_READLINE_ECHO=y
>>>>>
>>>>> Host system OS:
>>>>>        Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic
>>>>> #26~22.04.1-Ubuntu
>>>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
>>>>>
>>>>> Host system PATH:
>>>>>        /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
>>>>>        /home/mmoretti/bin
>>>>>        /home/mmoretti/tools/bin
>>>>>        /home/mmoretti/bin
>>>>>        /home/mmoretti/tools/bin
>>>>>        /home/mmoretti/.local/bin
>>>>>        /usr/local/sbin
>>>>>        /usr/local/bin
>>>>>        /usr/sbin
>>>>>        /usr/bin
>>>>>        /sbin
>>>>>        /bin
>>>>>        /usr/games
>>>>>        /usr/local/games
>>>>>        /snap/bin
>>>>>
>>>>> Espressif specific information:
>>>>>
>>>>> Bootloader version:
>>>>>        esp32: v5.1-dev-3972-g1559b6309f
>>>>>        esp32s2: Bootloader image not found
>>>>>        esp32s3: Bootloader image not found
>>>>>        esp32c2: Bootloader image not found
>>>>>        esp32c3: Bootloader image not found
>>>>>        esp32c6: Bootloader image not found
>>>>>        esp32h2: Bootloader image not found
>>>>>
>>>>> Toolchain version:
>>>>>        clang: Not found
>>>>>        gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
>>>>>        xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
>>>>> esp-12.2.0_20230208) 12.2.0
>>>>>        xtensa-esp32s2-elf-gcc: Not found
>>>>>        xtensa-esp32s3-elf-gcc: Not found
>>>>>        riscv32-esp-elf-gcc: Not found
>>>>>        riscv64-unknown-elf-gcc: Not found
>>>>>
>>>>> Esptool version: 4.6.2
>>>>>
>>>>> nsh>
>>>>>
>>>>>
>>>>> -m
>>>>>
>>>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
>>>>>> Hi Mike,
>>>>>>
>>>>>> We have been using NuttX on ESP32 for a while. The
>>>>>> `esp32-devkitc:blewifi`
>>>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS`
>>>>>> and
>>>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running
>>>>>> it.
>>>>>>
>>>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run
>>>>>> the
>>>>>> `nxdiag -all` from the NSH (please refer to
>>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag).
>>>>>> Please share your results for reevaluation ;)
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>
>>>>>>> It appears that when using the blewifi configuration out of the box,
>>>>>>> and
>>>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION,
>>>>>>> and
>>>>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as
>>>>>>> I've
>>>>>>> gotten so far.  I'm still tweaking other configs to see if they
>>>>>>> cause
>>>>>>> hanging as well.
>>>>>>>
>>>>>>> This just does NOT appear to be a stable OS on the ESP32.
>>>>>>>
>>>>>>> -m
>>>>>>>
>>>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>>>>>>> Hi!
>>>>>>>>
>>>>>>>> Good to know that! Yes, there are packages that need to be selected
>>>>>>>> to
>>>>>>> make
>>>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>>>>>>
>>>>>>>> Please note that BLE's log is enabled with the other wireless logs
>>>>>>> through
>>>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this
>>>>>>>> helps
>>>>>>>> debugging.
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>>
>>>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps
>>>>>>>>> and
>>>>>>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>>>>>>> configuration to work.  In my old tree, make distclean apparently
>>>>>>>>> didn't
>>>>>>>>> clean something, or my old tree was corrupt somehow.
>>>>>>>>>
>>>>>>>>> However, I still cannot get my own config to work (the one I
>>>>>>>>> previously
>>>>>>>>> attached).  There's a lot more stuff I need enabled than what is
>>>>>>>>> enabled
>>>>>>>>> by default in the blewifi configuration.  I guess I will just have
>>>>>>>>> to
>>>>>>>>> randomly keep modifying different config params until something
>>>>>>>>> works.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> -m
>>>>>>>>>
>>>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>>>>>>> Hi Mike,
>>>>>>>>>>
>>>>>>>>>> I found no trouble using the esp32-devkitc:blewifi configuration.
>>>>>>>>>> May
>>>>>>>>>> I
>>>>>>>>> ask
>>>>>>>>>> you to double-check your bootloader/partition-table
>>>>>>>>>> configuration?
>>>>>>>>>> (you
>>>>>>>>> can
>>>>>>>>>> refer to
>>>>>>>>>>
>>>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>>>>>>> ).
>>>>>>>>>>
>>>>>>>>>> If not successful yet, please do the following:
>>>>>>>>>>
>>>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag
>>>>>>>>>> -all`
>>>>>>>>>> from the NSH (please refer to
>>>>>>>>>>
>>>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>>>>>>> ).
>>>>>>>>>> Please share your results for reevaluattion ;)
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>>
>>>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>>>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI
>>>>>>>>>>> tests
>>>>>>>>>>> all
>>>>>>>>> the
>>>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>>>>>>
>>>>>>>>>>> I'll check.
>>>>>>>>>>>
>>>>>>>>>>> Best regards,
>>>>>>>>>>>
>>>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>>>>>>
>>>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I
>>>>>>>>>>>> get
>>>>>>>>> problems
>>>>>>>>>>>> with it telling me there's no bootable app.
>>>>>>>>>>>>
>>>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and
>>>>>>>>>>>> add
>>>>>>>>> wifi
>>>>>>>>>>>> and ble to it via menuconfig, I get only a little further.  It
>>>>>>>>>>>> gets
>>>>>>>>> past
>>>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.
>>>>>>>>>>>> With
>>>>>>>>> all the
>>>>>>>>>>>> ble options disabled and only wifi configured by itself it
>>>>>>>>>>>> actually
>>>>>>>>> boots
>>>>>>>>>>>> into nsh after some time.  (At first, I had a somewhat similar
>>>>>>>>>>>> issue
>>>>>>>>> with
>>>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't
>>>>>>>>>>>> defined
>>>>>>>>>>>> in
>>>>>>> the
>>>>>>>>>>>> config file, where it would seem to hang and then finally show
>>>>>>>>>>>> a
>>>>>>>>> prompt.
>>>>>>>>>>>> It wasn't until I actually figured out about turning on
>>>>>>>>>>>> CONFIG_DEBUG
>>>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of
>>>>>>>>>>>> errors
>>>>>>> during
>>>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to just
>>>>>>>>>>>> wait
>>>>>>>>> for it
>>>>>>>>>>>> a bit to show an nsh prompt.)
>>>>>>>>>>>>
>>>>>>>>>>>> However, there don't seem to be any config debug options for
>>>>>>> bluetooth.
>>>>>>>>>>>> I have no idea why it hangs as no messages are displayed and it
>>>>>>>>>>>> never
>>>>>>>>> shows
>>>>>>>>>>>> a prompt even after a half an hour.  I've now spent hours
>>>>>>>>>>>> messing
>>>>>>> with
>>>>>>>>>>>> various BLE configuration options with no luck.  I'm including
>>>>>>>>>>>> my
>>>>>>>>> config
>>>>>>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> -m
>>>>>>>>>>>> --
>>>>>>>>>>>> Mike Moretti
>>>>>>>>>>>> ♩♫♫♩♪♩
>>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Tiago Medicci Serrano
>>>>>>>>>>>
>>>>>>>>>>> Embedded Software Engineer
>>>>>>>>>>> MSc Electronics/Microelectronics
>>>>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>>>>>>> e:tiago.medicci@gmail.com
>>>>>>>>>>> a: Campinas, Brazil
>>>>>>>>>>> Follow me:
>>>>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>>>>>>> <https://github.com/tmedicci>
>>>>>>>>>>>
>>>
>
>

Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Mike Moretti <nu...@mordent.com.INVALID>.
Hi,

I totally get that NuttX is open source and community driven.

For me, and a lot of people I know in the embedded device industry, 
whenever I have to choose an OS or framework or library for a device 
product, whether it's open source or commercial, depending on the kind 
of product (real product vs prototype/proof of concept) I have to look 
at the reliability/maturity of it as well as the feature set to know if 
it meets the product's needs.

I wasn't around when my company made the choice to use NuttX, but now 
that I'm here, I'm worried that it will become my responsibility to 
support a product that runs on it (a real product that is supposed to be 
reliable), and that we are already months down the road developing with 
it, and as far as I know without really doing a good spike of up front 
work to validate it would meet the needs of the project both 
feature-wise and reliability-wise.

The first thing I wanted to know is "how reliable is NuttX" on the 
platform we're using, the esp32.  I googled "nuttx esp32", but didn't 
really find anything, not even a discussion forum or anything, just 
random people's blogs, and a one page doc of NuttX documentation about 
how to build it for the esp32 and what configurations there were.  No 
stack overflow questions, no other forums, no discussion anywhere at 
all.  I found that really really odd.  Maybe I didn't search properly?  
Maybe I did not look hard enough, but I didn't easily find any info on 
reliability or how things get tested, etc, does the platform support 
esp32, and what features of esp32 does it support and what is the state 
of those, and what about the different drivers and other features of 
NuttX (spi, uart, i2c, networking, ble, etc), what's the state of those, 
etc?

Then I found that the only place discussion seems to happen for NuttX is 
here on the dev mailing list.  Somehow it's not searchable via google?

Since I've started working on this project, I've run into problem after 
problem, either with configuration or building something, or something 
not working the way I think it's supposed to, or crashes/hangs (random 
spiffs crashes, weird random config param hanging), and I could never 
seem to find any discussion or even documentation about any of it 
online.  I also had a really hard time finding the info I needed in the 
documentation for various things, especially for things like the options 
in menuconfig and the relations between these options with each other  
(the other biggest one being that ble is completely undocumented).

I'm trying to keep an open mind, but I've seen other open 
source/community projects that seem to have better 
searchability/documentation/release info.

We aren't throwing out NuttX yet.  But somehow I'm going to have to 
figure out if we can actually use it and if it's going to be able to 
support all the stuff we need to do with it.  If we continue to use it, 
it will probably turn out that we end up contributing some stuff back.

Thanks,
-m

On 9/1/2023 1:47 PM, Tiago Medicci Serrano wrote:
> Hi!
>
> Mike, NuttX is a community-driven project. There are a lot of ongoing
> developments regarding CI testing, quality control and documentation
> improvements. This job is mostly done by individual developers, although
> there are some companies that help do that by keeping their own
> infrastructure to test CI.
>
> Making automated testing scenarios with actual hardware is a big task and
> we have been doing this lately to improve NuttX reliability. Making an
> open-source, POSIX-compliant, operational system is a huge task! I hope you
> can overcome your problems and help this amazing community!
>
> Please share your findings and help NuttX keeping improving ;)
>
> Best regards,
>
> Em sex., 1 de set. de 2023 às 14:33, Mike Moretti <nu...@mordent.com.invalid>
> escreveu:
>
>> 12.2.1 is an actual release.  How did it pass testing and end up as an
>> actual release?
>>
>> Unfortunately, all of this is leading me to believe that NuttX bluetooth
>> support for esp32 is just not mature or production quality and probably
>> should not be in any kind of actual "release" version of NuttX.  There
>> are no docs, and the latest actual release crashes in some random way
>> when some random configs are present.  It is also removing any
>> confidence I have that NuttX in general is reliable as a whole.  As it
>> is, the current state of ble in NuttX is going to probably end up making
>> us not able to continue to use NuttX.
>>
>> -m
>>
>> On 9/1/2023 1:16 PM, Tiago Medicci Serrano wrote:
>>> Hi!
>>>
>>> Well, I was finally able to reproduce something similar to what you've
>>> reported. When I switched to ` nuttx-12.2.1`, I was able to see the
>>> NuttShell console indication but I wasn't able to type anything on it.
>>>
>>> Could you please get nuttx from git e build from master?
>>>
>>> I did the same and I applied the following patch to the `blewifi`
>> defconfig:
>>> ```
>>> diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
>>> b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
>>> index c988cbc1d7..bb4db27b14 100644
>>> --- a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
>>> +++ b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
>>> @@ -6,7 +6,6 @@
>>>    # modifications.
>>>    #
>>>    # CONFIG_ARCH_LEDS is not set
>>> -# CONFIG_NDEBUG is not set
>>>    # CONFIG_NSH_ARGCAT is not set
>>>    # CONFIG_NSH_CMDOPT_HEXDUMP is not set
>>>    CONFIG_ALLOW_BSD_COMPONENTS=y
>>> @@ -25,6 +24,16 @@ CONFIG_BOARDCTL_RESET=y
>>>    CONFIG_BOARD_LOOPSPERMSEC=16717
>>>    CONFIG_BTSAK=y
>>>    CONFIG_BUILTIN=y
>>> +CONFIG_DEBUG_ASSERTIONS=y
>>> +CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
>>> +CONFIG_DEBUG_ERROR=y
>>> +CONFIG_DEBUG_FEATURES=y
>>> +CONFIG_DEBUG_INFO=y
>>> +CONFIG_DEBUG_WARN=y
>>> +CONFIG_DEBUG_WIRELESS=y
>>> +CONFIG_DEBUG_WIRELESS_ERROR=y
>>> +CONFIG_DEBUG_WIRELESS_INFO=y
>>> +CONFIG_DEBUG_WIRELESS_WARN=y
>>>    CONFIG_DEFAULT_TASK_STACKSIZE=4096
>>>    CONFIG_DEV_URANDOM=y
>>>    CONFIG_DISABLE_MQUEUE_NOTIFICATION=y
>>> @@ -32,6 +41,7 @@ CONFIG_DRIVERS_BLUETOOTH=y
>>>    CONFIG_DRIVERS_IEEE80211=y
>>>    CONFIG_DRIVERS_WIRELESS=y
>>>    CONFIG_ESP32_BLE=y
>>> +CONFIG_ESP32_MERGE_BINS=y
>>>    CONFIG_ESP32_RT_TIMER_TASK_STACK_SIZE=4096
>>>    CONFIG_ESP32_SPIFLASH=y
>>>    CONFIG_ESP32_SPIFLASH_SPIFFS=y
>>> ```
>>>
>>> `CONFIG_ESP32_MERGE_BINS` merges the bootloader and NuttX in a single
>>> binary. Please download it from
>>>
>> https://drive.google.com/file/d/1poFsQpZ_SW7X_5FOHWYMVfAln3uBfO-S/view?usp=sharing
>>> and try to flash it to your device (sha256:
>>> 40bcb3817eb3a0458161e35a2d08bbd663d7c16b197cdebe0cfeaa2529e8a684)
>>>
>>> `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 erase_flash && esptool.py
>> -c
>>> esp32 -p /dev/ttyUSB0 -b 921600 write_flash -fs detect -fm dio 0x0
>>> nuttx.merged.bin && minicom -D /dev/ttyUSB0`
>>>
>>> Tell me about your results. If it doesn't work, report me your console
>>> results and run the following tests using the same `esptool.py`:
>>>
>>> `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 chip_id && esptool.py -c
>>> esp32 -p /dev/ttyUSB0 -b 921600 flash_id`
>>>
>>> Best regards,
>>>
>>> Em sex., 1 de set. de 2023 às 11:26, Lucas Vaz
>>> <lu...@espressif.com.invalid> escreveu:
>>>
>>>> The make bootloader command, by default, downloads the most recent
>>>> pre-compiled binaries. Downloading them manually can still be done as
>> long
>>>> as you make sure you are grabbing the most recent version. You can also
>>>> build it (or MCUboot) from source by changing  the image configuration
>>>> options in the menuconfig.
>>>>
>>>> Cheers,
>>>> Lucas
>>>> ________________________________
>>>> From: Mike Moretti <nu...@mordent.com.INVALID>
>>>> Sent: Friday, September 1, 2023 11:14
>>>> To: dev@nuttx.apache.org <de...@nuttx.apache.org>
>>>> Subject: Re: Adding bluetooth configuration on esp32 hangs nsh
>>>>
>>>> [External: This email originated outside Espressif]
>>>>
>>>> <irony>Wait, so you're telling me I should submit a PR, but you spent
>>>> the time to document this on your own web site instead of submitting a
>>>> PR to the official NuttX docs yourself?</irony> ;-)
>>>>
>>>> -m
>>>>
>>>> On 9/1/2023 10:02 AM, Alan C. Assis wrote:
>>>>> Probably because we didn't update the documentation yet! :-)
>>>>>
>>>>> <irony> We're developers, we don't care about documentation...
>>>>> documentation is for wimps! </irony>
>>>>>
>>>>> Of course we need to improve our documentation! This is why all new PR
>>>>> introducing some new feature I insist to people include documentation.
>>>>>
>>>>> Please consider submitting a patch fixing it.
>>>>>
>>>>> BR,
>>>>>
>>>>> Alan
>>>>>
>>>>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>>>>> Wait, so, the NuttX docs say to just download the
>> bootloader/partitions
>>>>>> from some link.  If we have to make the bootloader ourselves why isn't
>>>>>> that part of the NuttX official documentation?
>>>>>>
>>>>>> -m
>>>>>>
>>>>>> On 9/1/2023 9:13 AM, Alan C. Assis wrote:
>>>>>>> Hi Mike,
>>>>>>>
>>>>>>> Please sure you are using the right bootloader too:
>>>>>>>
>>>>>>>
>> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
>>>>>>> BR,
>>>>>>>
>>>>>>> Alan
>>>>>>>
>>>>>>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> So, just to be sure, I made a completely fresh directory, untarred
>> the
>>>>>>>> 12.2.1 tarballs into it, did ./tools/configure.sh
>>>> esp32-devkitc:blewifi,
>>>>>>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and
>> then
>>>>>>>> flashed.  It boots to nsh but then doesn't accept any input; it's
>>>> hung.
>>>>>>>> If I have my wifi credentials in the config, so many messages come
>>>> out I
>>>>>>>> can't tell if it displayed the nsh prompt, but the last thing I see
>>>>>>>> before it hangs and doesn't accept any input is some message about
>>>> wifi
>>>>>>>> (I'm assuming it connected).
>>>>>>>>
>>>>>>>> I then tried, after yet another rm+untar (yes, I'm removing both
>> nuttx
>>>>>>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag,
>>>> but
>>>>>>>> it wouldn't build.
>>>>>>>>
>>>>>>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04
>>>> LTS)
>>>>>>>> for other projects, I've just been use the toolchain that comes with
>>>> it
>>>>>>>> instead of the "latest" one recommend via the NuttX docs link.
>>>>>>>> Unfortunately, it's a way older version of the gcc toolchain
>> (gcc-8.4
>>>> vs
>>>>>>>> gcc-12.2).
>>>>>>>>
>>>>>>>> So I installed the newer toolchain and esptool.py as directed by the
>>>>>>>> NuttX documentation.  I then opened a new shell without running the
>>>>>>>> ESP-IDF environment setup script, manually set my path to include
>> the
>>>>>>>> new toolchain, and tried again.  However, after yet another rm+untar
>>>> and
>>>>>>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I
>> still
>>>>>>>> get the same problem with it hanging.
>>>>>>>>
>>>>>>>> But luckily, with the newer toolchain, I'm at least able to build
>> and
>>>>>>>> run nxdiag and here is the output:
>>>>>>>>
>>>>>>>> nxdiag --all
>>>>>>>> Nxdiag Report:
>>>>>>>>
>>>>>>>> NuttX RTOS info:
>>>>>>>>          Hostname:
>>>>>>>>          Release: 12.2.1
>>>>>>>>          Build: 148c631a2d Sep  1 2023 08:45:59
>>>>>>>>          Arch: xtensa
>>>>>>>>          Defconfig: esp32-devkitc:nxdiag
>>>>>>>>
>>>>>>>> NuttX CFLAGS:
>>>>>>>>          -fno-common
>>>>>>>>          -Wall
>>>>>>>>          -Wstrict-prototypes
>>>>>>>>          -Wshadow
>>>>>>>>          -Wundef
>>>>>>>>          -Os
>>>>>>>>          -fno-strict-aliasing
>>>>>>>>          -fomit-frame-pointer
>>>>>>>>          -ffunction-sections
>>>>>>>>          -fdata-sections
>>>>>>>>          -mlongcalls
>>>>>>>>          -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>>>>>          -D__NuttX__
>>>>>>>>          -DNDEBUG
>>>>>>>>          -pipe
>>>>>>>>          -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>>>>>
>>>>>>>> NuttX CXXFLAGS:
>>>>>>>>          -fno-common
>>>>>>>>          -nostdinc++
>>>>>>>>          -Wall
>>>>>>>>          -Wshadow
>>>>>>>>          -Wundef
>>>>>>>>          -std="gnu++17"
>>>>>>>>          -fno-exceptions
>>>>>>>>          -fcheck-new
>>>>>>>>          -fno-rtti
>>>>>>>>          -Os
>>>>>>>>          -fno-strict-aliasing
>>>>>>>>          -fomit-frame-pointer
>>>>>>>>          -ffunction-sections
>>>>>>>>          -fdata-sections
>>>>>>>>          -mlongcalls
>>>>>>>>          -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
>>>>>>>>          -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>>>>>          -D__NuttX__
>>>>>>>>          -DNDEBUG
>>>>>>>>          -pipe
>>>>>>>>          -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>>>>>
>>>>>>>> NuttX LDFLAGS:
>>>>>>>>          -nostdlib
>>>>>>>>          --gc-sections
>>>>>>>>          --cref
>>>>>>>>          -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
>>>>>>>>
>>>>>>>> NuttX configuration options:
>>>>>>>>          CONFIG_HOST_LINUX=y
>>>>>>>>          CONFIG_APPS_DIR="../apps"
>>>>>>>>          CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
>>>>>>>>          CONFIG_BUILD_FLAT=y
>>>>>>>>          CONFIG_INTELHEX_BINARY=y
>>>>>>>>          CONFIG_ARCH_HAVE_STDARG_H=y
>>>>>>>>          CONFIG_ARCH_HAVE_SETJMP=y
>>>>>>>>          CONFIG_ARCH_NONE_DEBUG_H=y
>>>>>>>>          CONFIG_FORTIFY_SOURCE=0
>>>>>>>>          CONFIG_NDEBUG=y
>>>>>>>>          CONFIG_DEBUG_ALERT=y
>>>>>>>>          CONFIG_ARCH_HAVE_STACKCHECK=y
>>>>>>>>          CONFIG_ARCH_HAVE_CUSTOMOPT=y
>>>>>>>>          CONFIG_DEBUG_FULLOPT=y
>>>>>>>>          CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
>>>>>>>>          CONFIG_DEBUG_LINK_MAP=y
>>>>>>>>          CONFIG_ARCH_XTENSA=y
>>>>>>>>          CONFIG_ARCH="xtensa"
>>>>>>>>          CONFIG_ARCH_CHIP="esp32"
>>>>>>>>          CONFIG_ARCH_BOARD="esp32-devkitc"
>>>>>>>>          CONFIG_ARCH_CHIP_ESP32=y
>>>>>>>>          CONFIG_ARCH_FAMILY_LX6=y
>>>>>>>>          CONFIG_XTENSA_CP_INITSET=0x0001
>>>>>>>>          CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
>>>>>>>>          CONFIG_XTENSA_BTDEPTH=50
>>>>>>>>          CONFIG_XTENSA_TOOLCHAIN_ESP=y
>>>>>>>>          CONFIG_ARCH_CHIP_ESP32WROVER=y
>>>>>>>>          CONFIG_ESP32_DUAL_CPU=y
>>>>>>>>          CONFIG_ESP32_FLASH_4M=y
>>>>>>>>          CONFIG_ESP32_FLASH_DETECT=y
>>>>>>>>          CONFIG_ESP32_PSRAM_8M=y
>>>>>>>>          CONFIG_ESP32_ESP32DXWDXX=y
>>>>>>>>          CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
>>>>>>>>          CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
>>>>>>>>          CONFIG_ESP32_XTAL_40MZ=y
>>>>>>>>          CONFIG_ESP32_UART=y
>>>>>>>>          CONFIG_ESP32_RTC=y
>>>>>>>>          CONFIG_ESP32_UART0=y
>>>>>>>>          CONFIG_ESP32_BT_RESERVE_DRAM=0
>>>>>>>>          CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
>>>>>>>>          CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
>>>>>>>>          CONFIG_ESP32_UART0_TXPIN=1
>>>>>>>>          CONFIG_ESP32_UART0_RXPIN=3
>>>>>>>>          CONFIG_ESP32_FLASH_MODE_DIO=y
>>>>>>>>          CONFIG_ESP32_FLASH_FREQ_40M=y
>>>>>>>>          CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
>>>>>>>>          CONFIG_ESP32_APP_FORMAT_LEGACY=y
>>>>>>>>          CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
>>>>>>>>          CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
>>>>>>>>          CONFIG_ARCH_TOOLCHAIN_GNU=y
>>>>>>>>          CONFIG_LTO_NONE=y
>>>>>>>>          CONFIG_ARCH_VECNOTIRQ=y
>>>>>>>>          CONFIG_ARCH_HAVE_TEXT_HEAP=y
>>>>>>>>          CONFIG_ARCH_HAVE_MULTICPU=y
>>>>>>>>          CONFIG_ARCH_HAVE_FPU=y
>>>>>>>>          CONFIG_ARCH_HAVE_MPU=y
>>>>>>>>          CONFIG_ARCH_HAVE_RESET=y
>>>>>>>>          CONFIG_ARCH_HAVE_TESTSET=y
>>>>>>>>          CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
>>>>>>>>          CONFIG_ARCH_HAVE_BACKTRACE=y
>>>>>>>>          CONFIG_ARCH_HAVE_BOOTLOADER=y
>>>>>>>>          CONFIG_ARCH_HAVE_CPUINFO=y
>>>>>>>>          CONFIG_ARCH_FPU=y
>>>>>>>>          CONFIG_ARCH_STACKDUMP=y
>>>>>>>>          CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
>>>>>>>>          CONFIG_BOARD_LOOPSPERMSEC=16717
>>>>>>>>          CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
>>>>>>>>          CONFIG_ARCH_INTERRUPTSTACK=0
>>>>>>>>          CONFIG_BOOT_RUNFROMFLASH=y
>>>>>>>>          CONFIG_RAM_START=0x20000000
>>>>>>>>          CONFIG_RAM_SIZE=114688
>>>>>>>>          CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
>>>>>>>>          CONFIG_ARCH_HAVE_LEDS=y
>>>>>>>>          CONFIG_ARCH_HAVE_BUTTONS=y
>>>>>>>>          CONFIG_ARCH_BOARD_COMMON=y
>>>>>>>>          CONFIG_BOARDCTL=y
>>>>>>>>          CONFIG_BOARDCTL_MKRD=y
>>>>>>>>          CONFIG_DISABLE_OS_API=y
>>>>>>>>          CONFIG_USEC_PER_TICK=10000
>>>>>>>>          CONFIG_START_YEAR=2011
>>>>>>>>          CONFIG_START_MONTH=12
>>>>>>>>          CONFIG_START_DAY=6
>>>>>>>>          CONFIG_PREALLOC_TIMERS=4
>>>>>>>>          CONFIG_INIT_ENTRY=y
>>>>>>>>          CONFIG_INIT_ARGS=""
>>>>>>>>          CONFIG_INIT_STACKSIZE=2048
>>>>>>>>          CONFIG_INIT_PRIORITY=100
>>>>>>>>          CONFIG_INIT_ENTRYPOINT="nsh_main"
>>>>>>>>          CONFIG_INIT_ENTRYNAME="nsh_main"
>>>>>>>>          CONFIG_RR_INTERVAL=200
>>>>>>>>          CONFIG_TASK_NAME_SIZE=31
>>>>>>>>          CONFIG_SCHED_WAITPID=y
>>>>>>>>          CONFIG_PTHREAD_MUTEX_ROBUST=y
>>>>>>>>          CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
>>>>>>>>          CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
>>>>>>>>          CONFIG_DEV_CONSOLE=y
>>>>>>>>          CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
>>>>>>>>          CONFIG_FILE_STREAM=y
>>>>>>>>          CONFIG_NAME_MAX=32
>>>>>>>>          CONFIG_PATH_MAX=256
>>>>>>>>          CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
>>>>>>>>          CONFIG_PREALLOC_MQ_MSGS=8
>>>>>>>>          CONFIG_PREALLOC_MQ_IRQ_MSGS=8
>>>>>>>>          CONFIG_MQ_MAXMSGSIZE=32
>>>>>>>>          CONFIG_DEFAULT_TASK_STACKSIZE=2048
>>>>>>>>          CONFIG_IDLETHREAD_STACKSIZE=3072
>>>>>>>>          CONFIG_PTHREAD_STACK_MIN=256
>>>>>>>>          CONFIG_PTHREAD_STACK_DEFAULT=2048
>>>>>>>>          CONFIG_ARCH_HAVE_I2CRESET=y
>>>>>>>>          CONFIG_DEV_NULL=y
>>>>>>>>          CONFIG_DRVR_MKRD=y
>>>>>>>>          CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
>>>>>>>>          CONFIG_SERIAL=y
>>>>>>>>          CONFIG_SERIAL_CONSOLE=y
>>>>>>>>          CONFIG_MCU_SERIAL=y
>>>>>>>>          CONFIG_STANDARD_SERIAL=y
>>>>>>>>          CONFIG_SERIAL_NPOLLWAITERS=4
>>>>>>>>          CONFIG_UART0_SERIAL_CONSOLE=y
>>>>>>>>          CONFIG_UART0_SERIALDRIVER=y
>>>>>>>>          CONFIG_UART0_RXBUFSIZE=256
>>>>>>>>          CONFIG_UART0_TXBUFSIZE=256
>>>>>>>>          CONFIG_UART0_BAUD=115200
>>>>>>>>          CONFIG_UART0_BITS=8
>>>>>>>>          CONFIG_UART0_PARITY=0
>>>>>>>>          CONFIG_UART0_2STOP=0
>>>>>>>>          CONFIG_SYSLOG_MAX_CHANNELS=1
>>>>>>>>          CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
>>>>>>>>          CONFIG_SYSLOG_DEFAULT=y
>>>>>>>>          CONFIG_FS_NEPOLL_DESCRIPTORS=8
>>>>>>>>          CONFIG_SENDFILE_BUFSIZE=512
>>>>>>>>          CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
>>>>>>>>          CONFIG_FS_MQUEUE_NPOLLWAITERS=4
>>>>>>>>          CONFIG_FS_ANONMAP=y
>>>>>>>>          CONFIG_FS_PROCFS=y
>>>>>>>>          CONFIG_FS_PROCFS_MAX_TASKS=128
>>>>>>>>          CONFIG_NXFONTS_PACKEDMSFIRST=y
>>>>>>>>          CONFIG_MM_DEFAULT_MANAGER=y
>>>>>>>>          CONFIG_MM_DFAULT_ALIGNMENT=0
>>>>>>>>          CONFIG_MM_REGIONS=3
>>>>>>>>          CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
>>>>>>>>          CONFIG_MM_BACKTRACE=-1
>>>>>>>>          CONFIG_STDIO_BUFFER_SIZE=64
>>>>>>>>          CONFIG_STDIO_LINEBUFFER=y
>>>>>>>>          CONFIG_NUNGET_CHARS=2
>>>>>>>>          CONFIG_LIBC_FLOATINGPOINT=y
>>>>>>>>          CONFIG_LIBC_LONG_LONG=y
>>>>>>>>          CONFIG_ARCH_LOWPUTC=y
>>>>>>>>          CONFIG_LIBC_ARCH_ATOMIC=y
>>>>>>>>          CONFIG_LIBC_ARCH_MEMCHR=y
>>>>>>>>          CONFIG_LIBC_ARCH_MEMCPY=y
>>>>>>>>          CONFIG_LIBC_ARCH_MEMCMP=y
>>>>>>>>          CONFIG_LIBC_ARCH_MEMMOVE=y
>>>>>>>>          CONFIG_LIBC_ARCH_MEMSET=y
>>>>>>>>          CONFIG_LIBC_ARCH_STRCHR=y
>>>>>>>>          CONFIG_LIBC_ARCH_STRCMP=y
>>>>>>>>          CONFIG_LIBC_ARCH_STRCPY=y
>>>>>>>>          CONFIG_LIBC_ARCH_STRLCPY=y
>>>>>>>>          CONFIG_LIBC_ARCH_STRNCPY=y
>>>>>>>>          CONFIG_LIBC_ARCH_STRLEN=y
>>>>>>>>          CONFIG_LIBC_ARCH_STRNLEN=y
>>>>>>>>          CONFIG_LIBC_PREVENT_STRING_KERNEL=y
>>>>>>>>          CONFIG_LIBC_RAND_ORDER=1
>>>>>>>>          CONFIG_LIBC_HOMEDIR="/"
>>>>>>>>          CONFIG_LIBC_TMPDIR="/tmp"
>>>>>>>>          CONFIG_LIBC_MAX_TMPFILE=32
>>>>>>>>          CONFIG_LIBC_MAX_EXITFUNS=0
>>>>>>>>          CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
>>>>>>>>          CONFIG_LIBC_HOSTNAME=""
>>>>>>>>          CONFIG_LIBC_OPEN_MAX=256
>>>>>>>>          CONFIG_LIBC_STRERROR_ERRNUM=y
>>>>>>>>          CONFIG_LIBC_STRSIGNAL=y
>>>>>>>>          CONFIG_TLS_NELEM=4
>>>>>>>>          CONFIG_TLS_TASK_NELEM=0
>>>>>>>>          CONFIG_LIBC_GAISTRERROR_ERRNUM=y
>>>>>>>>          CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
>>>>>>>>          CONFIG_LIBC_MEMFD_ERROR=y
>>>>>>>>          CONFIG_BUILTIN=y
>>>>>>>>          CONFIG_STREAM_OUT_BUFFER_SIZE=64
>>>>>>>>          CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
>>>>>>>>          CONFIG_LIBM_TOOLCHAIN=y
>>>>>>>>          CONFIG_HAVE_CXX=y
>>>>>>>>          CONFIG_HAVE_CXXINITIALIZE=y
>>>>>>>>          CONFIG_LIBCXXMINI=y
>>>>>>>>          CONFIG_CXX_STANDARD="gnu++17"
>>>>>>>>          CONFIG_NSH_LIBRARY=y
>>>>>>>>          CONFIG_NSH_PROMPT_STRING="nsh> "
>>>>>>>>          CONFIG_NSH_READLINE=y
>>>>>>>>          CONFIG_NSH_LINELEN=64
>>>>>>>>          CONFIG_NSH_MAXARGUMENTS=7
>>>>>>>>          CONFIG_NSH_NESTDEPTH=3
>>>>>>>>          CONFIG_NSH_ALIAS=y
>>>>>>>>          CONFIG_NSH_ALIAS_MAX_AMOUNT=1
>>>>>>>>          CONFIG_NSH_BUILTIN_APPS=y
>>>>>>>>          CONFIG_NSH_DISABLE_DATE=y
>>>>>>>>          CONFIG_NSH_DISABLE_LOSMART=y
>>>>>>>>          CONFIG_NSH_DISABLE_LOMTD=y
>>>>>>>>          CONFIG_NSH_DISABLE_MB=y
>>>>>>>>          CONFIG_NSH_DISABLE_MH=y
>>>>>>>>          CONFIG_NSH_DISABLE_MW=y
>>>>>>>>          CONFIG_NSH_DISABLE_TIMEDATECTL=y
>>>>>>>>          CONFIG_NSH_CODECS_BUFSIZE=128
>>>>>>>>          CONFIG_NSH_PROC_MOUNTPOINT="/proc"
>>>>>>>>          CONFIG_NSH_FILEIOSIZE=512
>>>>>>>>          CONFIG_NSH_CONSOLE=y
>>>>>>>>          CONFIG_NSH_ARCHINIT=y
>>>>>>>>          CONFIG_SYSTEM_NSH=y
>>>>>>>>          CONFIG_SYSTEM_NSH_PRIORITY=100
>>>>>>>>          CONFIG_SYSTEM_NSH_STACKSIZE=2048
>>>>>>>>          CONFIG_SYSTEM_NSH_PROGNAME="nsh"
>>>>>>>>          CONFIG_SYSTEM_NXDIAG=y
>>>>>>>>          CONFIG_SYSTEM_NXDIAG_PRIORITY=100
>>>>>>>>          CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
>>>>>>>>          CONFIG_SYSTEM_NXDIAG_CONF=y
>>>>>>>>          CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
>>>>>>>>          CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
>>>>>>>>          CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
>>>>>>>>          CONFIG_SYSTEM_READLINE=y
>>>>>>>>          CONFIG_READLINE_HAVE_EXTMATCH=y
>>>>>>>>          CONFIG_READLINE_ECHO=y
>>>>>>>>
>>>>>>>> Host system OS:
>>>>>>>>          Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic
>>>> #26~22.04.1-Ubuntu
>>>>>>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
>>>>>>>>
>>>>>>>> Host system PATH:
>>>>>>>>          /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
>>>>>>>>          /home/mmoretti/bin
>>>>>>>>          /home/mmoretti/tools/bin
>>>>>>>>          /home/mmoretti/bin
>>>>>>>>          /home/mmoretti/tools/bin
>>>>>>>>          /home/mmoretti/.local/bin
>>>>>>>>          /usr/local/sbin
>>>>>>>>          /usr/local/bin
>>>>>>>>          /usr/sbin
>>>>>>>>          /usr/bin
>>>>>>>>          /sbin
>>>>>>>>          /bin
>>>>>>>>          /usr/games
>>>>>>>>          /usr/local/games
>>>>>>>>          /snap/bin
>>>>>>>>
>>>>>>>> Espressif specific information:
>>>>>>>>
>>>>>>>> Bootloader version:
>>>>>>>>          esp32: v5.1-dev-3972-g1559b6309f
>>>>>>>>          esp32s2: Bootloader image not found
>>>>>>>>          esp32s3: Bootloader image not found
>>>>>>>>          esp32c2: Bootloader image not found
>>>>>>>>          esp32c3: Bootloader image not found
>>>>>>>>          esp32c6: Bootloader image not found
>>>>>>>>          esp32h2: Bootloader image not found
>>>>>>>>
>>>>>>>> Toolchain version:
>>>>>>>>          clang: Not found
>>>>>>>>          gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
>>>>>>>>          xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
>>>>>>>> esp-12.2.0_20230208) 12.2.0
>>>>>>>>          xtensa-esp32s2-elf-gcc: Not found
>>>>>>>>          xtensa-esp32s3-elf-gcc: Not found
>>>>>>>>          riscv32-esp-elf-gcc: Not found
>>>>>>>>          riscv64-unknown-elf-gcc: Not found
>>>>>>>>
>>>>>>>> Esptool version: 4.6.2
>>>>>>>>
>>>>>>>> nsh>
>>>>>>>>
>>>>>>>>
>>>>>>>> -m
>>>>>>>>
>>>>>>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
>>>>>>>>> Hi Mike,
>>>>>>>>>
>>>>>>>>> We have been using NuttX on ESP32 for a while. The
>>>>>>>>> `esp32-devkitc:blewifi`
>>>>>>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS`
>>>> and
>>>>>>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running
>>>> it.
>>>>>>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run
>>>> the
>>>>>>>>> `nxdiag -all` from the NSH (please refer to
>>>>>>>>>
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>> ).
>>>>>>>>> Please share your results for reevaluation ;)
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>>
>>>>>>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>
>>>>>>>>>> It appears that when using the blewifi configuration out of the
>> box,
>>>>>>>>>> and
>>>>>>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION,
>>>> and
>>>>>>>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as
>>>> I've
>>>>>>>>>> gotten so far.  I'm still tweaking other configs to see if they
>>>> cause
>>>>>>>>>> hanging as well.
>>>>>>>>>>
>>>>>>>>>> This just does NOT appear to be a stable OS on the ESP32.
>>>>>>>>>>
>>>>>>>>>> -m
>>>>>>>>>>
>>>>>>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>>>>>>>>>> Hi!
>>>>>>>>>>>
>>>>>>>>>>> Good to know that! Yes, there are packages that need to be
>> selected
>>>>>>>>>>> to
>>>>>>>>>> make
>>>>>>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>>>>>>>>>
>>>>>>>>>>> Please note that BLE's log is enabled with the other wireless
>> logs
>>>>>>>>>> through
>>>>>>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this
>>>> helps
>>>>>>>>>>> debugging.
>>>>>>>>>>>
>>>>>>>>>>> Best regards,
>>>>>>>>>>>
>>>>>>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks.  It wasn't until I untarred a whole new copy of
>> nuttx+apps
>>>>>>>>>>>> and
>>>>>>>>>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>>>>>>>>>> configuration to work.  In my old tree, make distclean
>> apparently
>>>>>>>>>>>> didn't
>>>>>>>>>>>> clean something, or my old tree was corrupt somehow.
>>>>>>>>>>>>
>>>>>>>>>>>> However, I still cannot get my own config to work (the one I
>>>>>>>>>>>> previously
>>>>>>>>>>>> attached).  There's a lot more stuff I need enabled than what is
>>>>>>>>>>>> enabled
>>>>>>>>>>>> by default in the blewifi configuration.  I guess I will just
>> have
>>>>>>>>>>>> to
>>>>>>>>>>>> randomly keep modifying different config params until something
>>>>>>>>>>>> works.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> -m
>>>>>>>>>>>>
>>>>>>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>>>>>>>>>> Hi Mike,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I found no trouble using the esp32-devkitc:blewifi
>> configuration.
>>>>>>>>>>>>> May
>>>>>>>>>>>>> I
>>>>>>>>>>>> ask
>>>>>>>>>>>>> you to double-check your bootloader/partition-table
>>>> configuration?
>>>>>>>>>>>>> (you
>>>>>>>>>>>> can
>>>>>>>>>>>>> refer to
>>>>>>>>>>>>>
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>>>>>>>>>> ).
>>>>>>>>>>>>>
>>>>>>>>>>>>> If not successful yet, please do the following:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the
>> `nxdiag
>>>>>>>>>>>>> -all`
>>>>>>>>>>>>> from the NSH (please refer to
>>>>>>>>>>>>>
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>>>>>>>>>> ).
>>>>>>>>>>>>> Please share your results for reevaluattion ;)
>>>>>>>>>>>>>
>>>>>>>>>>>>> Best regards,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>>>>>>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI
>>>> tests
>>>>>>>>>>>>>> all
>>>>>>>>>>>> the
>>>>>>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I'll check.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Best regards,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I
>>>> get
>>>>>>>>>>>> problems
>>>>>>>>>>>>>>> with it telling me there's no bootable app.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration
>> and
>>>>>>>>>>>>>>> add
>>>>>>>>>>>> wifi
>>>>>>>>>>>>>>> and ble to it via menuconfig, I get only a little further.
>> It
>>>>>>>>>>>>>>> gets
>>>>>>>>>>>> past
>>>>>>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.
>>>>>>>>>>>>>>> With
>>>>>>>>>>>> all the
>>>>>>>>>>>>>>> ble options disabled and only wifi configured by itself it
>>>>>>>>>>>>>>> actually
>>>>>>>>>>>> boots
>>>>>>>>>>>>>>> into nsh after some time.  (At first, I had a somewhat
>> similar
>>>>>>>>>>>>>>> issue
>>>>>>>>>>>> with
>>>>>>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't
>>>> defined
>>>>>>>>>>>>>>> in
>>>>>>>>>> the
>>>>>>>>>>>>>>> config file, where it would seem to hang and then finally
>> show
>>>> a
>>>>>>>>>>>> prompt.
>>>>>>>>>>>>>>> It wasn't until I actually figured out about turning on
>>>>>>>>>>>>>>> CONFIG_DEBUG
>>>>>>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of
>>>> errors
>>>>>>>>>> during
>>>>>>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to
>> just
>>>>>>>>>>>>>>> wait
>>>>>>>>>>>> for it
>>>>>>>>>>>>>>> a bit to show an nsh prompt.)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> However, there don't seem to be any config debug options for
>>>>>>>>>> bluetooth.
>>>>>>>>>>>>>>> I have no idea why it hangs as no messages are displayed and
>> it
>>>>>>>>>>>>>>> never
>>>>>>>>>>>> shows
>>>>>>>>>>>>>>> a prompt even after a half an hour.  I've now spent hours
>>>> messing
>>>>>>>>>> with
>>>>>>>>>>>>>>> various BLE configuration options with no luck.  I'm
>> including
>>>> my
>>>>>>>>>>>> config
>>>>>>>>>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>> -m
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>> Mike Moretti
>>>>>>>>>>>>>>> ♩♫♫♩♪♩
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
>>>>>>>>>>>>>> Tiago Medicci Serrano
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Embedded Software Engineer
>>>>>>>>>>>>>> MSc Electronics/Microelectronics
>>>>>>>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>>>>>>>>>> e:tiago.medicci@gmail.com
>>>>>>>>>>>>>> a: Campinas, Brazil
>>>>>>>>>>>>>> Follow me:
>>>>>>>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>>>>>>>>>> <https://github.com/tmedicci>
>>>>>>>>>>>>>>
>>


Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Tiago Medicci Serrano <ti...@gmail.com>.
Hi!

Mike, NuttX is a community-driven project. There are a lot of ongoing
developments regarding CI testing, quality control and documentation
improvements. This job is mostly done by individual developers, although
there are some companies that help do that by keeping their own
infrastructure to test CI.

Making automated testing scenarios with actual hardware is a big task and
we have been doing this lately to improve NuttX reliability. Making an
open-source, POSIX-compliant, operational system is a huge task! I hope you
can overcome your problems and help this amazing community!

Please share your findings and help NuttX keeping improving ;)

Best regards,

Em sex., 1 de set. de 2023 às 14:33, Mike Moretti <nu...@mordent.com.invalid>
escreveu:

> 12.2.1 is an actual release.  How did it pass testing and end up as an
> actual release?
>
> Unfortunately, all of this is leading me to believe that NuttX bluetooth
> support for esp32 is just not mature or production quality and probably
> should not be in any kind of actual "release" version of NuttX.  There
> are no docs, and the latest actual release crashes in some random way
> when some random configs are present.  It is also removing any
> confidence I have that NuttX in general is reliable as a whole.  As it
> is, the current state of ble in NuttX is going to probably end up making
> us not able to continue to use NuttX.
>
> -m
>
> On 9/1/2023 1:16 PM, Tiago Medicci Serrano wrote:
> > Hi!
> >
> > Well, I was finally able to reproduce something similar to what you've
> > reported. When I switched to ` nuttx-12.2.1`, I was able to see the
> > NuttShell console indication but I wasn't able to type anything on it.
> >
> > Could you please get nuttx from git e build from master?
> >
> > I did the same and I applied the following patch to the `blewifi`
> defconfig:
> >
> > ```
> > diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
> > b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
> > index c988cbc1d7..bb4db27b14 100644
> > --- a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
> > +++ b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
> > @@ -6,7 +6,6 @@
> >   # modifications.
> >   #
> >   # CONFIG_ARCH_LEDS is not set
> > -# CONFIG_NDEBUG is not set
> >   # CONFIG_NSH_ARGCAT is not set
> >   # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> >   CONFIG_ALLOW_BSD_COMPONENTS=y
> > @@ -25,6 +24,16 @@ CONFIG_BOARDCTL_RESET=y
> >   CONFIG_BOARD_LOOPSPERMSEC=16717
> >   CONFIG_BTSAK=y
> >   CONFIG_BUILTIN=y
> > +CONFIG_DEBUG_ASSERTIONS=y
> > +CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
> > +CONFIG_DEBUG_ERROR=y
> > +CONFIG_DEBUG_FEATURES=y
> > +CONFIG_DEBUG_INFO=y
> > +CONFIG_DEBUG_WARN=y
> > +CONFIG_DEBUG_WIRELESS=y
> > +CONFIG_DEBUG_WIRELESS_ERROR=y
> > +CONFIG_DEBUG_WIRELESS_INFO=y
> > +CONFIG_DEBUG_WIRELESS_WARN=y
> >   CONFIG_DEFAULT_TASK_STACKSIZE=4096
> >   CONFIG_DEV_URANDOM=y
> >   CONFIG_DISABLE_MQUEUE_NOTIFICATION=y
> > @@ -32,6 +41,7 @@ CONFIG_DRIVERS_BLUETOOTH=y
> >   CONFIG_DRIVERS_IEEE80211=y
> >   CONFIG_DRIVERS_WIRELESS=y
> >   CONFIG_ESP32_BLE=y
> > +CONFIG_ESP32_MERGE_BINS=y
> >   CONFIG_ESP32_RT_TIMER_TASK_STACK_SIZE=4096
> >   CONFIG_ESP32_SPIFLASH=y
> >   CONFIG_ESP32_SPIFLASH_SPIFFS=y
> > ```
> >
> > `CONFIG_ESP32_MERGE_BINS` merges the bootloader and NuttX in a single
> > binary. Please download it from
> >
> https://drive.google.com/file/d/1poFsQpZ_SW7X_5FOHWYMVfAln3uBfO-S/view?usp=sharing
> > and try to flash it to your device (sha256:
> > 40bcb3817eb3a0458161e35a2d08bbd663d7c16b197cdebe0cfeaa2529e8a684)
> >
> > `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 erase_flash && esptool.py
> -c
> > esp32 -p /dev/ttyUSB0 -b 921600 write_flash -fs detect -fm dio 0x0
> > nuttx.merged.bin && minicom -D /dev/ttyUSB0`
> >
> > Tell me about your results. If it doesn't work, report me your console
> > results and run the following tests using the same `esptool.py`:
> >
> > `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 chip_id && esptool.py -c
> > esp32 -p /dev/ttyUSB0 -b 921600 flash_id`
> >
> > Best regards,
> >
> > Em sex., 1 de set. de 2023 às 11:26, Lucas Vaz
> > <lu...@espressif.com.invalid> escreveu:
> >
> >> The make bootloader command, by default, downloads the most recent
> >> pre-compiled binaries. Downloading them manually can still be done as
> long
> >> as you make sure you are grabbing the most recent version. You can also
> >> build it (or MCUboot) from source by changing  the image configuration
> >> options in the menuconfig.
> >>
> >> Cheers,
> >> Lucas
> >> ________________________________
> >> From: Mike Moretti <nu...@mordent.com.INVALID>
> >> Sent: Friday, September 1, 2023 11:14
> >> To: dev@nuttx.apache.org <de...@nuttx.apache.org>
> >> Subject: Re: Adding bluetooth configuration on esp32 hangs nsh
> >>
> >> [External: This email originated outside Espressif]
> >>
> >> <irony>Wait, so you're telling me I should submit a PR, but you spent
> >> the time to document this on your own web site instead of submitting a
> >> PR to the official NuttX docs yourself?</irony> ;-)
> >>
> >> -m
> >>
> >> On 9/1/2023 10:02 AM, Alan C. Assis wrote:
> >>> Probably because we didn't update the documentation yet! :-)
> >>>
> >>> <irony> We're developers, we don't care about documentation...
> >>> documentation is for wimps! </irony>
> >>>
> >>> Of course we need to improve our documentation! This is why all new PR
> >>> introducing some new feature I insist to people include documentation.
> >>>
> >>> Please consider submitting a patch fixing it.
> >>>
> >>> BR,
> >>>
> >>> Alan
> >>>
> >>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
> >>>> Wait, so, the NuttX docs say to just download the
> bootloader/partitions
> >>>> from some link.  If we have to make the bootloader ourselves why isn't
> >>>> that part of the NuttX official documentation?
> >>>>
> >>>> -m
> >>>>
> >>>> On 9/1/2023 9:13 AM, Alan C. Assis wrote:
> >>>>> Hi Mike,
> >>>>>
> >>>>> Please sure you are using the right bootloader too:
> >>>>>
> >>>>>
> >>
> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
> >>>>> BR,
> >>>>>
> >>>>> Alan
> >>>>>
> >>>>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
> >>>>>> Hi,
> >>>>>>
> >>>>>> So, just to be sure, I made a completely fresh directory, untarred
> the
> >>>>>> 12.2.1 tarballs into it, did ./tools/configure.sh
> >> esp32-devkitc:blewifi,
> >>>>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and
> then
> >>>>>> flashed.  It boots to nsh but then doesn't accept any input; it's
> >> hung.
> >>>>>> If I have my wifi credentials in the config, so many messages come
> >> out I
> >>>>>> can't tell if it displayed the nsh prompt, but the last thing I see
> >>>>>> before it hangs and doesn't accept any input is some message about
> >> wifi
> >>>>>> (I'm assuming it connected).
> >>>>>>
> >>>>>> I then tried, after yet another rm+untar (yes, I'm removing both
> nuttx
> >>>>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag,
> >> but
> >>>>>> it wouldn't build.
> >>>>>>
> >>>>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04
> >> LTS)
> >>>>>> for other projects, I've just been use the toolchain that comes with
> >> it
> >>>>>> instead of the "latest" one recommend via the NuttX docs link.
> >>>>>> Unfortunately, it's a way older version of the gcc toolchain
> (gcc-8.4
> >> vs
> >>>>>> gcc-12.2).
> >>>>>>
> >>>>>> So I installed the newer toolchain and esptool.py as directed by the
> >>>>>> NuttX documentation.  I then opened a new shell without running the
> >>>>>> ESP-IDF environment setup script, manually set my path to include
> the
> >>>>>> new toolchain, and tried again.  However, after yet another rm+untar
> >> and
> >>>>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I
> still
> >>>>>> get the same problem with it hanging.
> >>>>>>
> >>>>>> But luckily, with the newer toolchain, I'm at least able to build
> and
> >>>>>> run nxdiag and here is the output:
> >>>>>>
> >>>>>> nxdiag --all
> >>>>>> Nxdiag Report:
> >>>>>>
> >>>>>> NuttX RTOS info:
> >>>>>>         Hostname:
> >>>>>>         Release: 12.2.1
> >>>>>>         Build: 148c631a2d Sep  1 2023 08:45:59
> >>>>>>         Arch: xtensa
> >>>>>>         Defconfig: esp32-devkitc:nxdiag
> >>>>>>
> >>>>>> NuttX CFLAGS:
> >>>>>>         -fno-common
> >>>>>>         -Wall
> >>>>>>         -Wstrict-prototypes
> >>>>>>         -Wshadow
> >>>>>>         -Wundef
> >>>>>>         -Os
> >>>>>>         -fno-strict-aliasing
> >>>>>>         -fomit-frame-pointer
> >>>>>>         -ffunction-sections
> >>>>>>         -fdata-sections
> >>>>>>         -mlongcalls
> >>>>>>         -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
> >>>>>>         -D__NuttX__
> >>>>>>         -DNDEBUG
> >>>>>>         -pipe
> >>>>>>         -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
> >>>>>>
> >>>>>> NuttX CXXFLAGS:
> >>>>>>         -fno-common
> >>>>>>         -nostdinc++
> >>>>>>         -Wall
> >>>>>>         -Wshadow
> >>>>>>         -Wundef
> >>>>>>         -std="gnu++17"
> >>>>>>         -fno-exceptions
> >>>>>>         -fcheck-new
> >>>>>>         -fno-rtti
> >>>>>>         -Os
> >>>>>>         -fno-strict-aliasing
> >>>>>>         -fomit-frame-pointer
> >>>>>>         -ffunction-sections
> >>>>>>         -fdata-sections
> >>>>>>         -mlongcalls
> >>>>>>         -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
> >>>>>>         -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
> >>>>>>         -D__NuttX__
> >>>>>>         -DNDEBUG
> >>>>>>         -pipe
> >>>>>>         -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
> >>>>>>
> >>>>>> NuttX LDFLAGS:
> >>>>>>         -nostdlib
> >>>>>>         --gc-sections
> >>>>>>         --cref
> >>>>>>         -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
> >>>>>>
> >>>>>> NuttX configuration options:
> >>>>>>         CONFIG_HOST_LINUX=y
> >>>>>>         CONFIG_APPS_DIR="../apps"
> >>>>>>         CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
> >>>>>>         CONFIG_BUILD_FLAT=y
> >>>>>>         CONFIG_INTELHEX_BINARY=y
> >>>>>>         CONFIG_ARCH_HAVE_STDARG_H=y
> >>>>>>         CONFIG_ARCH_HAVE_SETJMP=y
> >>>>>>         CONFIG_ARCH_NONE_DEBUG_H=y
> >>>>>>         CONFIG_FORTIFY_SOURCE=0
> >>>>>>         CONFIG_NDEBUG=y
> >>>>>>         CONFIG_DEBUG_ALERT=y
> >>>>>>         CONFIG_ARCH_HAVE_STACKCHECK=y
> >>>>>>         CONFIG_ARCH_HAVE_CUSTOMOPT=y
> >>>>>>         CONFIG_DEBUG_FULLOPT=y
> >>>>>>         CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
> >>>>>>         CONFIG_DEBUG_LINK_MAP=y
> >>>>>>         CONFIG_ARCH_XTENSA=y
> >>>>>>         CONFIG_ARCH="xtensa"
> >>>>>>         CONFIG_ARCH_CHIP="esp32"
> >>>>>>         CONFIG_ARCH_BOARD="esp32-devkitc"
> >>>>>>         CONFIG_ARCH_CHIP_ESP32=y
> >>>>>>         CONFIG_ARCH_FAMILY_LX6=y
> >>>>>>         CONFIG_XTENSA_CP_INITSET=0x0001
> >>>>>>         CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
> >>>>>>         CONFIG_XTENSA_BTDEPTH=50
> >>>>>>         CONFIG_XTENSA_TOOLCHAIN_ESP=y
> >>>>>>         CONFIG_ARCH_CHIP_ESP32WROVER=y
> >>>>>>         CONFIG_ESP32_DUAL_CPU=y
> >>>>>>         CONFIG_ESP32_FLASH_4M=y
> >>>>>>         CONFIG_ESP32_FLASH_DETECT=y
> >>>>>>         CONFIG_ESP32_PSRAM_8M=y
> >>>>>>         CONFIG_ESP32_ESP32DXWDXX=y
> >>>>>>         CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
> >>>>>>         CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
> >>>>>>         CONFIG_ESP32_XTAL_40MZ=y
> >>>>>>         CONFIG_ESP32_UART=y
> >>>>>>         CONFIG_ESP32_RTC=y
> >>>>>>         CONFIG_ESP32_UART0=y
> >>>>>>         CONFIG_ESP32_BT_RESERVE_DRAM=0
> >>>>>>         CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
> >>>>>>         CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
> >>>>>>         CONFIG_ESP32_UART0_TXPIN=1
> >>>>>>         CONFIG_ESP32_UART0_RXPIN=3
> >>>>>>         CONFIG_ESP32_FLASH_MODE_DIO=y
> >>>>>>         CONFIG_ESP32_FLASH_FREQ_40M=y
> >>>>>>         CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
> >>>>>>         CONFIG_ESP32_APP_FORMAT_LEGACY=y
> >>>>>>         CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
> >>>>>>         CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
> >>>>>>         CONFIG_ARCH_TOOLCHAIN_GNU=y
> >>>>>>         CONFIG_LTO_NONE=y
> >>>>>>         CONFIG_ARCH_VECNOTIRQ=y
> >>>>>>         CONFIG_ARCH_HAVE_TEXT_HEAP=y
> >>>>>>         CONFIG_ARCH_HAVE_MULTICPU=y
> >>>>>>         CONFIG_ARCH_HAVE_FPU=y
> >>>>>>         CONFIG_ARCH_HAVE_MPU=y
> >>>>>>         CONFIG_ARCH_HAVE_RESET=y
> >>>>>>         CONFIG_ARCH_HAVE_TESTSET=y
> >>>>>>         CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
> >>>>>>         CONFIG_ARCH_HAVE_BACKTRACE=y
> >>>>>>         CONFIG_ARCH_HAVE_BOOTLOADER=y
> >>>>>>         CONFIG_ARCH_HAVE_CPUINFO=y
> >>>>>>         CONFIG_ARCH_FPU=y
> >>>>>>         CONFIG_ARCH_STACKDUMP=y
> >>>>>>         CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
> >>>>>>         CONFIG_BOARD_LOOPSPERMSEC=16717
> >>>>>>         CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
> >>>>>>         CONFIG_ARCH_INTERRUPTSTACK=0
> >>>>>>         CONFIG_BOOT_RUNFROMFLASH=y
> >>>>>>         CONFIG_RAM_START=0x20000000
> >>>>>>         CONFIG_RAM_SIZE=114688
> >>>>>>         CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
> >>>>>>         CONFIG_ARCH_HAVE_LEDS=y
> >>>>>>         CONFIG_ARCH_HAVE_BUTTONS=y
> >>>>>>         CONFIG_ARCH_BOARD_COMMON=y
> >>>>>>         CONFIG_BOARDCTL=y
> >>>>>>         CONFIG_BOARDCTL_MKRD=y
> >>>>>>         CONFIG_DISABLE_OS_API=y
> >>>>>>         CONFIG_USEC_PER_TICK=10000
> >>>>>>         CONFIG_START_YEAR=2011
> >>>>>>         CONFIG_START_MONTH=12
> >>>>>>         CONFIG_START_DAY=6
> >>>>>>         CONFIG_PREALLOC_TIMERS=4
> >>>>>>         CONFIG_INIT_ENTRY=y
> >>>>>>         CONFIG_INIT_ARGS=""
> >>>>>>         CONFIG_INIT_STACKSIZE=2048
> >>>>>>         CONFIG_INIT_PRIORITY=100
> >>>>>>         CONFIG_INIT_ENTRYPOINT="nsh_main"
> >>>>>>         CONFIG_INIT_ENTRYNAME="nsh_main"
> >>>>>>         CONFIG_RR_INTERVAL=200
> >>>>>>         CONFIG_TASK_NAME_SIZE=31
> >>>>>>         CONFIG_SCHED_WAITPID=y
> >>>>>>         CONFIG_PTHREAD_MUTEX_ROBUST=y
> >>>>>>         CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
> >>>>>>         CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
> >>>>>>         CONFIG_DEV_CONSOLE=y
> >>>>>>         CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
> >>>>>>         CONFIG_FILE_STREAM=y
> >>>>>>         CONFIG_NAME_MAX=32
> >>>>>>         CONFIG_PATH_MAX=256
> >>>>>>         CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
> >>>>>>         CONFIG_PREALLOC_MQ_MSGS=8
> >>>>>>         CONFIG_PREALLOC_MQ_IRQ_MSGS=8
> >>>>>>         CONFIG_MQ_MAXMSGSIZE=32
> >>>>>>         CONFIG_DEFAULT_TASK_STACKSIZE=2048
> >>>>>>         CONFIG_IDLETHREAD_STACKSIZE=3072
> >>>>>>         CONFIG_PTHREAD_STACK_MIN=256
> >>>>>>         CONFIG_PTHREAD_STACK_DEFAULT=2048
> >>>>>>         CONFIG_ARCH_HAVE_I2CRESET=y
> >>>>>>         CONFIG_DEV_NULL=y
> >>>>>>         CONFIG_DRVR_MKRD=y
> >>>>>>         CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
> >>>>>>         CONFIG_SERIAL=y
> >>>>>>         CONFIG_SERIAL_CONSOLE=y
> >>>>>>         CONFIG_MCU_SERIAL=y
> >>>>>>         CONFIG_STANDARD_SERIAL=y
> >>>>>>         CONFIG_SERIAL_NPOLLWAITERS=4
> >>>>>>         CONFIG_UART0_SERIAL_CONSOLE=y
> >>>>>>         CONFIG_UART0_SERIALDRIVER=y
> >>>>>>         CONFIG_UART0_RXBUFSIZE=256
> >>>>>>         CONFIG_UART0_TXBUFSIZE=256
> >>>>>>         CONFIG_UART0_BAUD=115200
> >>>>>>         CONFIG_UART0_BITS=8
> >>>>>>         CONFIG_UART0_PARITY=0
> >>>>>>         CONFIG_UART0_2STOP=0
> >>>>>>         CONFIG_SYSLOG_MAX_CHANNELS=1
> >>>>>>         CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
> >>>>>>         CONFIG_SYSLOG_DEFAULT=y
> >>>>>>         CONFIG_FS_NEPOLL_DESCRIPTORS=8
> >>>>>>         CONFIG_SENDFILE_BUFSIZE=512
> >>>>>>         CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
> >>>>>>         CONFIG_FS_MQUEUE_NPOLLWAITERS=4
> >>>>>>         CONFIG_FS_ANONMAP=y
> >>>>>>         CONFIG_FS_PROCFS=y
> >>>>>>         CONFIG_FS_PROCFS_MAX_TASKS=128
> >>>>>>         CONFIG_NXFONTS_PACKEDMSFIRST=y
> >>>>>>         CONFIG_MM_DEFAULT_MANAGER=y
> >>>>>>         CONFIG_MM_DFAULT_ALIGNMENT=0
> >>>>>>         CONFIG_MM_REGIONS=3
> >>>>>>         CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
> >>>>>>         CONFIG_MM_BACKTRACE=-1
> >>>>>>         CONFIG_STDIO_BUFFER_SIZE=64
> >>>>>>         CONFIG_STDIO_LINEBUFFER=y
> >>>>>>         CONFIG_NUNGET_CHARS=2
> >>>>>>         CONFIG_LIBC_FLOATINGPOINT=y
> >>>>>>         CONFIG_LIBC_LONG_LONG=y
> >>>>>>         CONFIG_ARCH_LOWPUTC=y
> >>>>>>         CONFIG_LIBC_ARCH_ATOMIC=y
> >>>>>>         CONFIG_LIBC_ARCH_MEMCHR=y
> >>>>>>         CONFIG_LIBC_ARCH_MEMCPY=y
> >>>>>>         CONFIG_LIBC_ARCH_MEMCMP=y
> >>>>>>         CONFIG_LIBC_ARCH_MEMMOVE=y
> >>>>>>         CONFIG_LIBC_ARCH_MEMSET=y
> >>>>>>         CONFIG_LIBC_ARCH_STRCHR=y
> >>>>>>         CONFIG_LIBC_ARCH_STRCMP=y
> >>>>>>         CONFIG_LIBC_ARCH_STRCPY=y
> >>>>>>         CONFIG_LIBC_ARCH_STRLCPY=y
> >>>>>>         CONFIG_LIBC_ARCH_STRNCPY=y
> >>>>>>         CONFIG_LIBC_ARCH_STRLEN=y
> >>>>>>         CONFIG_LIBC_ARCH_STRNLEN=y
> >>>>>>         CONFIG_LIBC_PREVENT_STRING_KERNEL=y
> >>>>>>         CONFIG_LIBC_RAND_ORDER=1
> >>>>>>         CONFIG_LIBC_HOMEDIR="/"
> >>>>>>         CONFIG_LIBC_TMPDIR="/tmp"
> >>>>>>         CONFIG_LIBC_MAX_TMPFILE=32
> >>>>>>         CONFIG_LIBC_MAX_EXITFUNS=0
> >>>>>>         CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
> >>>>>>         CONFIG_LIBC_HOSTNAME=""
> >>>>>>         CONFIG_LIBC_OPEN_MAX=256
> >>>>>>         CONFIG_LIBC_STRERROR_ERRNUM=y
> >>>>>>         CONFIG_LIBC_STRSIGNAL=y
> >>>>>>         CONFIG_TLS_NELEM=4
> >>>>>>         CONFIG_TLS_TASK_NELEM=0
> >>>>>>         CONFIG_LIBC_GAISTRERROR_ERRNUM=y
> >>>>>>         CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
> >>>>>>         CONFIG_LIBC_MEMFD_ERROR=y
> >>>>>>         CONFIG_BUILTIN=y
> >>>>>>         CONFIG_STREAM_OUT_BUFFER_SIZE=64
> >>>>>>         CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
> >>>>>>         CONFIG_LIBM_TOOLCHAIN=y
> >>>>>>         CONFIG_HAVE_CXX=y
> >>>>>>         CONFIG_HAVE_CXXINITIALIZE=y
> >>>>>>         CONFIG_LIBCXXMINI=y
> >>>>>>         CONFIG_CXX_STANDARD="gnu++17"
> >>>>>>         CONFIG_NSH_LIBRARY=y
> >>>>>>         CONFIG_NSH_PROMPT_STRING="nsh> "
> >>>>>>         CONFIG_NSH_READLINE=y
> >>>>>>         CONFIG_NSH_LINELEN=64
> >>>>>>         CONFIG_NSH_MAXARGUMENTS=7
> >>>>>>         CONFIG_NSH_NESTDEPTH=3
> >>>>>>         CONFIG_NSH_ALIAS=y
> >>>>>>         CONFIG_NSH_ALIAS_MAX_AMOUNT=1
> >>>>>>         CONFIG_NSH_BUILTIN_APPS=y
> >>>>>>         CONFIG_NSH_DISABLE_DATE=y
> >>>>>>         CONFIG_NSH_DISABLE_LOSMART=y
> >>>>>>         CONFIG_NSH_DISABLE_LOMTD=y
> >>>>>>         CONFIG_NSH_DISABLE_MB=y
> >>>>>>         CONFIG_NSH_DISABLE_MH=y
> >>>>>>         CONFIG_NSH_DISABLE_MW=y
> >>>>>>         CONFIG_NSH_DISABLE_TIMEDATECTL=y
> >>>>>>         CONFIG_NSH_CODECS_BUFSIZE=128
> >>>>>>         CONFIG_NSH_PROC_MOUNTPOINT="/proc"
> >>>>>>         CONFIG_NSH_FILEIOSIZE=512
> >>>>>>         CONFIG_NSH_CONSOLE=y
> >>>>>>         CONFIG_NSH_ARCHINIT=y
> >>>>>>         CONFIG_SYSTEM_NSH=y
> >>>>>>         CONFIG_SYSTEM_NSH_PRIORITY=100
> >>>>>>         CONFIG_SYSTEM_NSH_STACKSIZE=2048
> >>>>>>         CONFIG_SYSTEM_NSH_PROGNAME="nsh"
> >>>>>>         CONFIG_SYSTEM_NXDIAG=y
> >>>>>>         CONFIG_SYSTEM_NXDIAG_PRIORITY=100
> >>>>>>         CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
> >>>>>>         CONFIG_SYSTEM_NXDIAG_CONF=y
> >>>>>>         CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
> >>>>>>         CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
> >>>>>>         CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
> >>>>>>         CONFIG_SYSTEM_READLINE=y
> >>>>>>         CONFIG_READLINE_HAVE_EXTMATCH=y
> >>>>>>         CONFIG_READLINE_ECHO=y
> >>>>>>
> >>>>>> Host system OS:
> >>>>>>         Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic
> >> #26~22.04.1-Ubuntu
> >>>>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
> >>>>>>
> >>>>>> Host system PATH:
> >>>>>>         /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
> >>>>>>         /home/mmoretti/bin
> >>>>>>         /home/mmoretti/tools/bin
> >>>>>>         /home/mmoretti/bin
> >>>>>>         /home/mmoretti/tools/bin
> >>>>>>         /home/mmoretti/.local/bin
> >>>>>>         /usr/local/sbin
> >>>>>>         /usr/local/bin
> >>>>>>         /usr/sbin
> >>>>>>         /usr/bin
> >>>>>>         /sbin
> >>>>>>         /bin
> >>>>>>         /usr/games
> >>>>>>         /usr/local/games
> >>>>>>         /snap/bin
> >>>>>>
> >>>>>> Espressif specific information:
> >>>>>>
> >>>>>> Bootloader version:
> >>>>>>         esp32: v5.1-dev-3972-g1559b6309f
> >>>>>>         esp32s2: Bootloader image not found
> >>>>>>         esp32s3: Bootloader image not found
> >>>>>>         esp32c2: Bootloader image not found
> >>>>>>         esp32c3: Bootloader image not found
> >>>>>>         esp32c6: Bootloader image not found
> >>>>>>         esp32h2: Bootloader image not found
> >>>>>>
> >>>>>> Toolchain version:
> >>>>>>         clang: Not found
> >>>>>>         gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
> >>>>>>         xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
> >>>>>> esp-12.2.0_20230208) 12.2.0
> >>>>>>         xtensa-esp32s2-elf-gcc: Not found
> >>>>>>         xtensa-esp32s3-elf-gcc: Not found
> >>>>>>         riscv32-esp-elf-gcc: Not found
> >>>>>>         riscv64-unknown-elf-gcc: Not found
> >>>>>>
> >>>>>> Esptool version: 4.6.2
> >>>>>>
> >>>>>> nsh>
> >>>>>>
> >>>>>>
> >>>>>> -m
> >>>>>>
> >>>>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
> >>>>>>> Hi Mike,
> >>>>>>>
> >>>>>>> We have been using NuttX on ESP32 for a while. The
> >>>>>>> `esp32-devkitc:blewifi`
> >>>>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS`
> >> and
> >>>>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running
> >> it.
> >>>>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run
> >> the
> >>>>>>> `nxdiag -all` from the NSH (please refer to
> >>>>>>>
> >>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
> >> ).
> >>>>>>> Please share your results for reevaluation ;)
> >>>>>>>
> >>>>>>> Best regards,
> >>>>>>>
> >>>>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
> >>>>>>> <nu...@mordent.com.invalid>  escreveu:
> >>>>>>>
> >>>>>>>> It appears that when using the blewifi configuration out of the
> box,
> >>>>>>>> and
> >>>>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION,
> >> and
> >>>>>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as
> >> I've
> >>>>>>>> gotten so far.  I'm still tweaking other configs to see if they
> >> cause
> >>>>>>>> hanging as well.
> >>>>>>>>
> >>>>>>>> This just does NOT appear to be a stable OS on the ESP32.
> >>>>>>>>
> >>>>>>>> -m
> >>>>>>>>
> >>>>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
> >>>>>>>>> Hi!
> >>>>>>>>>
> >>>>>>>>> Good to know that! Yes, there are packages that need to be
> selected
> >>>>>>>>> to
> >>>>>>>> make
> >>>>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
> >>>>>>>>>
> >>>>>>>>> Please note that BLE's log is enabled with the other wireless
> logs
> >>>>>>>> through
> >>>>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this
> >> helps
> >>>>>>>>> debugging.
> >>>>>>>>>
> >>>>>>>>> Best regards,
> >>>>>>>>>
> >>>>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
> >>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
> >>>>>>>>>
> >>>>>>>>>> Hi,
> >>>>>>>>>>
> >>>>>>>>>> Thanks.  It wasn't until I untarred a whole new copy of
> nuttx+apps
> >>>>>>>>>> and
> >>>>>>>>>> ran tools/configure.sh with blewifi that I was able to get that
> >>>>>>>>>> configuration to work.  In my old tree, make distclean
> apparently
> >>>>>>>>>> didn't
> >>>>>>>>>> clean something, or my old tree was corrupt somehow.
> >>>>>>>>>>
> >>>>>>>>>> However, I still cannot get my own config to work (the one I
> >>>>>>>>>> previously
> >>>>>>>>>> attached).  There's a lot more stuff I need enabled than what is
> >>>>>>>>>> enabled
> >>>>>>>>>> by default in the blewifi configuration.  I guess I will just
> have
> >>>>>>>>>> to
> >>>>>>>>>> randomly keep modifying different config params until something
> >>>>>>>>>> works.
> >>>>>>>>>>
> >>>>>>>>>> Thanks,
> >>>>>>>>>> -m
> >>>>>>>>>>
> >>>>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
> >>>>>>>>>>> Hi Mike,
> >>>>>>>>>>>
> >>>>>>>>>>> I found no trouble using the esp32-devkitc:blewifi
> configuration.
> >>>>>>>>>>> May
> >>>>>>>>>>> I
> >>>>>>>>>> ask
> >>>>>>>>>>> you to double-check your bootloader/partition-table
> >> configuration?
> >>>>>>>>>>> (you
> >>>>>>>>>> can
> >>>>>>>>>>> refer to
> >>>>>>>>>>>
> >>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
> >>>>>>>>>>> ).
> >>>>>>>>>>>
> >>>>>>>>>>> If not successful yet, please do the following:
> >>>>>>>>>>>
> >>>>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the
> `nxdiag
> >>>>>>>>>>> -all`
> >>>>>>>>>>> from the NSH (please refer to
> >>>>>>>>>>>
> >>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
> >>>>>>>>>> ).
> >>>>>>>>>>> Please share your results for reevaluattion ;)
> >>>>>>>>>>>
> >>>>>>>>>>> Best regards,
> >>>>>>>>>>>
> >>>>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
> >>>>>>>>>>> tiago.medicci@gmail.com> escreveu:
> >>>>>>>>>>>
> >>>>>>>>>>>> Hi,
> >>>>>>>>>>>>
> >>>>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI
> >> tests
> >>>>>>>>>>>> all
> >>>>>>>>>> the
> >>>>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
> >>>>>>>>>>>>
> >>>>>>>>>>>> I'll check.
> >>>>>>>>>>>>
> >>>>>>>>>>>> Best regards,
> >>>>>>>>>>>>
> >>>>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
> >>>>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
> >>>>>>>>>>>>
> >>>>>>>>>>>>> Hi,
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
> >>>>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I
> >> get
> >>>>>>>>>> problems
> >>>>>>>>>>>>> with it telling me there's no bootable app.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration
> and
> >>>>>>>>>>>>> add
> >>>>>>>>>> wifi
> >>>>>>>>>>>>> and ble to it via menuconfig, I get only a little further.
> It
> >>>>>>>>>>>>> gets
> >>>>>>>>>> past
> >>>>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.
> >>>>>>>>>>>>> With
> >>>>>>>>>> all the
> >>>>>>>>>>>>> ble options disabled and only wifi configured by itself it
> >>>>>>>>>>>>> actually
> >>>>>>>>>> boots
> >>>>>>>>>>>>> into nsh after some time.  (At first, I had a somewhat
> similar
> >>>>>>>>>>>>> issue
> >>>>>>>>>> with
> >>>>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't
> >> defined
> >>>>>>>>>>>>> in
> >>>>>>>> the
> >>>>>>>>>>>>> config file, where it would seem to hang and then finally
> show
> >> a
> >>>>>>>>>> prompt.
> >>>>>>>>>>>>> It wasn't until I actually figured out about turning on
> >>>>>>>>>>>>> CONFIG_DEBUG
> >>>>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of
> >> errors
> >>>>>>>> during
> >>>>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to
> just
> >>>>>>>>>>>>> wait
> >>>>>>>>>> for it
> >>>>>>>>>>>>> a bit to show an nsh prompt.)
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> However, there don't seem to be any config debug options for
> >>>>>>>> bluetooth.
> >>>>>>>>>>>>> I have no idea why it hangs as no messages are displayed and
> it
> >>>>>>>>>>>>> never
> >>>>>>>>>> shows
> >>>>>>>>>>>>> a prompt even after a half an hour.  I've now spent hours
> >> messing
> >>>>>>>> with
> >>>>>>>>>>>>> various BLE configuration options with no luck.  I'm
> including
> >> my
> >>>>>>>>>> config
> >>>>>>>>>>>>> file in hope that someone might see something wrong with it.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Thanks,
> >>>>>>>>>>>>> -m
> >>>>>>>>>>>>> --
> >>>>>>>>>>>>> Mike Moretti
> >>>>>>>>>>>>> ♩♫♫♩♪♩
> >>>>>>>>>>>>>
> >>>>>>>>>>>> --
> >>>>>>>>>>>> Tiago Medicci Serrano
> >>>>>>>>>>>>
> >>>>>>>>>>>> Embedded Software Engineer
> >>>>>>>>>>>> MSc Electronics/Microelectronics
> >>>>>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
> >>>>>>>>>>>> e:tiago.medicci@gmail.com
> >>>>>>>>>>>> a: Campinas, Brazil
> >>>>>>>>>>>> Follow me:
> >>>>>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
> >>>>>>>>>>>> <https://github.com/tmedicci>
> >>>>>>>>>>>>
> >>
>
>

-- 
Tiago Medicci Serrano

Embedded Software Engineer
MSc Electronics/Microelectronics
m: +55 (19) 981403886 <+55+(19)+981403886>
e: tiago.medicci@gmail.com
a: Campinas, Brazil
Follow me:
<https://www.linkedin.com/in/tiago-serrano-924458b6>
<https://github.com/tmedicci>

Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Mike Moretti <nu...@mordent.com.INVALID>.
12.2.1 is an actual release.  How did it pass testing and end up as an 
actual release?

Unfortunately, all of this is leading me to believe that NuttX bluetooth 
support for esp32 is just not mature or production quality and probably 
should not be in any kind of actual "release" version of NuttX.  There 
are no docs, and the latest actual release crashes in some random way 
when some random configs are present.  It is also removing any 
confidence I have that NuttX in general is reliable as a whole.  As it 
is, the current state of ble in NuttX is going to probably end up making 
us not able to continue to use NuttX.

-m

On 9/1/2023 1:16 PM, Tiago Medicci Serrano wrote:
> Hi!
>
> Well, I was finally able to reproduce something similar to what you've
> reported. When I switched to ` nuttx-12.2.1`, I was able to see the
> NuttShell console indication but I wasn't able to type anything on it.
>
> Could you please get nuttx from git e build from master?
>
> I did the same and I applied the following patch to the `blewifi` defconfig:
>
> ```
> diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
> b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
> index c988cbc1d7..bb4db27b14 100644
> --- a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
> +++ b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
> @@ -6,7 +6,6 @@
>   # modifications.
>   #
>   # CONFIG_ARCH_LEDS is not set
> -# CONFIG_NDEBUG is not set
>   # CONFIG_NSH_ARGCAT is not set
>   # CONFIG_NSH_CMDOPT_HEXDUMP is not set
>   CONFIG_ALLOW_BSD_COMPONENTS=y
> @@ -25,6 +24,16 @@ CONFIG_BOARDCTL_RESET=y
>   CONFIG_BOARD_LOOPSPERMSEC=16717
>   CONFIG_BTSAK=y
>   CONFIG_BUILTIN=y
> +CONFIG_DEBUG_ASSERTIONS=y
> +CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
> +CONFIG_DEBUG_ERROR=y
> +CONFIG_DEBUG_FEATURES=y
> +CONFIG_DEBUG_INFO=y
> +CONFIG_DEBUG_WARN=y
> +CONFIG_DEBUG_WIRELESS=y
> +CONFIG_DEBUG_WIRELESS_ERROR=y
> +CONFIG_DEBUG_WIRELESS_INFO=y
> +CONFIG_DEBUG_WIRELESS_WARN=y
>   CONFIG_DEFAULT_TASK_STACKSIZE=4096
>   CONFIG_DEV_URANDOM=y
>   CONFIG_DISABLE_MQUEUE_NOTIFICATION=y
> @@ -32,6 +41,7 @@ CONFIG_DRIVERS_BLUETOOTH=y
>   CONFIG_DRIVERS_IEEE80211=y
>   CONFIG_DRIVERS_WIRELESS=y
>   CONFIG_ESP32_BLE=y
> +CONFIG_ESP32_MERGE_BINS=y
>   CONFIG_ESP32_RT_TIMER_TASK_STACK_SIZE=4096
>   CONFIG_ESP32_SPIFLASH=y
>   CONFIG_ESP32_SPIFLASH_SPIFFS=y
> ```
>
> `CONFIG_ESP32_MERGE_BINS` merges the bootloader and NuttX in a single
> binary. Please download it from
> https://drive.google.com/file/d/1poFsQpZ_SW7X_5FOHWYMVfAln3uBfO-S/view?usp=sharing
> and try to flash it to your device (sha256:
> 40bcb3817eb3a0458161e35a2d08bbd663d7c16b197cdebe0cfeaa2529e8a684)
>
> `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 erase_flash && esptool.py -c
> esp32 -p /dev/ttyUSB0 -b 921600 write_flash -fs detect -fm dio 0x0
> nuttx.merged.bin && minicom -D /dev/ttyUSB0`
>
> Tell me about your results. If it doesn't work, report me your console
> results and run the following tests using the same `esptool.py`:
>
> `esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 chip_id && esptool.py -c
> esp32 -p /dev/ttyUSB0 -b 921600 flash_id`
>
> Best regards,
>
> Em sex., 1 de set. de 2023 às 11:26, Lucas Vaz
> <lu...@espressif.com.invalid> escreveu:
>
>> The make bootloader command, by default, downloads the most recent
>> pre-compiled binaries. Downloading them manually can still be done as long
>> as you make sure you are grabbing the most recent version. You can also
>> build it (or MCUboot) from source by changing  the image configuration
>> options in the menuconfig.
>>
>> Cheers,
>> Lucas
>> ________________________________
>> From: Mike Moretti <nu...@mordent.com.INVALID>
>> Sent: Friday, September 1, 2023 11:14
>> To: dev@nuttx.apache.org <de...@nuttx.apache.org>
>> Subject: Re: Adding bluetooth configuration on esp32 hangs nsh
>>
>> [External: This email originated outside Espressif]
>>
>> <irony>Wait, so you're telling me I should submit a PR, but you spent
>> the time to document this on your own web site instead of submitting a
>> PR to the official NuttX docs yourself?</irony> ;-)
>>
>> -m
>>
>> On 9/1/2023 10:02 AM, Alan C. Assis wrote:
>>> Probably because we didn't update the documentation yet! :-)
>>>
>>> <irony> We're developers, we don't care about documentation...
>>> documentation is for wimps! </irony>
>>>
>>> Of course we need to improve our documentation! This is why all new PR
>>> introducing some new feature I insist to people include documentation.
>>>
>>> Please consider submitting a patch fixing it.
>>>
>>> BR,
>>>
>>> Alan
>>>
>>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>>> Wait, so, the NuttX docs say to just download the bootloader/partitions
>>>> from some link.  If we have to make the bootloader ourselves why isn't
>>>> that part of the NuttX official documentation?
>>>>
>>>> -m
>>>>
>>>> On 9/1/2023 9:13 AM, Alan C. Assis wrote:
>>>>> Hi Mike,
>>>>>
>>>>> Please sure you are using the right bootloader too:
>>>>>
>>>>>
>> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
>>>>> BR,
>>>>>
>>>>> Alan
>>>>>
>>>>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> So, just to be sure, I made a completely fresh directory, untarred the
>>>>>> 12.2.1 tarballs into it, did ./tools/configure.sh
>> esp32-devkitc:blewifi,
>>>>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then
>>>>>> flashed.  It boots to nsh but then doesn't accept any input; it's
>> hung.
>>>>>> If I have my wifi credentials in the config, so many messages come
>> out I
>>>>>> can't tell if it displayed the nsh prompt, but the last thing I see
>>>>>> before it hangs and doesn't accept any input is some message about
>> wifi
>>>>>> (I'm assuming it connected).
>>>>>>
>>>>>> I then tried, after yet another rm+untar (yes, I'm removing both nuttx
>>>>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag,
>> but
>>>>>> it wouldn't build.
>>>>>>
>>>>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04
>> LTS)
>>>>>> for other projects, I've just been use the toolchain that comes with
>> it
>>>>>> instead of the "latest" one recommend via the NuttX docs link.
>>>>>> Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4
>> vs
>>>>>> gcc-12.2).
>>>>>>
>>>>>> So I installed the newer toolchain and esptool.py as directed by the
>>>>>> NuttX documentation.  I then opened a new shell without running the
>>>>>> ESP-IDF environment setup script, manually set my path to include the
>>>>>> new toolchain, and tried again.  However, after yet another rm+untar
>> and
>>>>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I still
>>>>>> get the same problem with it hanging.
>>>>>>
>>>>>> But luckily, with the newer toolchain, I'm at least able to build and
>>>>>> run nxdiag and here is the output:
>>>>>>
>>>>>> nxdiag --all
>>>>>> Nxdiag Report:
>>>>>>
>>>>>> NuttX RTOS info:
>>>>>>         Hostname:
>>>>>>         Release: 12.2.1
>>>>>>         Build: 148c631a2d Sep  1 2023 08:45:59
>>>>>>         Arch: xtensa
>>>>>>         Defconfig: esp32-devkitc:nxdiag
>>>>>>
>>>>>> NuttX CFLAGS:
>>>>>>         -fno-common
>>>>>>         -Wall
>>>>>>         -Wstrict-prototypes
>>>>>>         -Wshadow
>>>>>>         -Wundef
>>>>>>         -Os
>>>>>>         -fno-strict-aliasing
>>>>>>         -fomit-frame-pointer
>>>>>>         -ffunction-sections
>>>>>>         -fdata-sections
>>>>>>         -mlongcalls
>>>>>>         -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>>>         -D__NuttX__
>>>>>>         -DNDEBUG
>>>>>>         -pipe
>>>>>>         -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>>>
>>>>>> NuttX CXXFLAGS:
>>>>>>         -fno-common
>>>>>>         -nostdinc++
>>>>>>         -Wall
>>>>>>         -Wshadow
>>>>>>         -Wundef
>>>>>>         -std="gnu++17"
>>>>>>         -fno-exceptions
>>>>>>         -fcheck-new
>>>>>>         -fno-rtti
>>>>>>         -Os
>>>>>>         -fno-strict-aliasing
>>>>>>         -fomit-frame-pointer
>>>>>>         -ffunction-sections
>>>>>>         -fdata-sections
>>>>>>         -mlongcalls
>>>>>>         -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
>>>>>>         -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>>>         -D__NuttX__
>>>>>>         -DNDEBUG
>>>>>>         -pipe
>>>>>>         -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>>>
>>>>>> NuttX LDFLAGS:
>>>>>>         -nostdlib
>>>>>>         --gc-sections
>>>>>>         --cref
>>>>>>         -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
>>>>>>
>>>>>> NuttX configuration options:
>>>>>>         CONFIG_HOST_LINUX=y
>>>>>>         CONFIG_APPS_DIR="../apps"
>>>>>>         CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
>>>>>>         CONFIG_BUILD_FLAT=y
>>>>>>         CONFIG_INTELHEX_BINARY=y
>>>>>>         CONFIG_ARCH_HAVE_STDARG_H=y
>>>>>>         CONFIG_ARCH_HAVE_SETJMP=y
>>>>>>         CONFIG_ARCH_NONE_DEBUG_H=y
>>>>>>         CONFIG_FORTIFY_SOURCE=0
>>>>>>         CONFIG_NDEBUG=y
>>>>>>         CONFIG_DEBUG_ALERT=y
>>>>>>         CONFIG_ARCH_HAVE_STACKCHECK=y
>>>>>>         CONFIG_ARCH_HAVE_CUSTOMOPT=y
>>>>>>         CONFIG_DEBUG_FULLOPT=y
>>>>>>         CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
>>>>>>         CONFIG_DEBUG_LINK_MAP=y
>>>>>>         CONFIG_ARCH_XTENSA=y
>>>>>>         CONFIG_ARCH="xtensa"
>>>>>>         CONFIG_ARCH_CHIP="esp32"
>>>>>>         CONFIG_ARCH_BOARD="esp32-devkitc"
>>>>>>         CONFIG_ARCH_CHIP_ESP32=y
>>>>>>         CONFIG_ARCH_FAMILY_LX6=y
>>>>>>         CONFIG_XTENSA_CP_INITSET=0x0001
>>>>>>         CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
>>>>>>         CONFIG_XTENSA_BTDEPTH=50
>>>>>>         CONFIG_XTENSA_TOOLCHAIN_ESP=y
>>>>>>         CONFIG_ARCH_CHIP_ESP32WROVER=y
>>>>>>         CONFIG_ESP32_DUAL_CPU=y
>>>>>>         CONFIG_ESP32_FLASH_4M=y
>>>>>>         CONFIG_ESP32_FLASH_DETECT=y
>>>>>>         CONFIG_ESP32_PSRAM_8M=y
>>>>>>         CONFIG_ESP32_ESP32DXWDXX=y
>>>>>>         CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
>>>>>>         CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
>>>>>>         CONFIG_ESP32_XTAL_40MZ=y
>>>>>>         CONFIG_ESP32_UART=y
>>>>>>         CONFIG_ESP32_RTC=y
>>>>>>         CONFIG_ESP32_UART0=y
>>>>>>         CONFIG_ESP32_BT_RESERVE_DRAM=0
>>>>>>         CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
>>>>>>         CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
>>>>>>         CONFIG_ESP32_UART0_TXPIN=1
>>>>>>         CONFIG_ESP32_UART0_RXPIN=3
>>>>>>         CONFIG_ESP32_FLASH_MODE_DIO=y
>>>>>>         CONFIG_ESP32_FLASH_FREQ_40M=y
>>>>>>         CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
>>>>>>         CONFIG_ESP32_APP_FORMAT_LEGACY=y
>>>>>>         CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
>>>>>>         CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
>>>>>>         CONFIG_ARCH_TOOLCHAIN_GNU=y
>>>>>>         CONFIG_LTO_NONE=y
>>>>>>         CONFIG_ARCH_VECNOTIRQ=y
>>>>>>         CONFIG_ARCH_HAVE_TEXT_HEAP=y
>>>>>>         CONFIG_ARCH_HAVE_MULTICPU=y
>>>>>>         CONFIG_ARCH_HAVE_FPU=y
>>>>>>         CONFIG_ARCH_HAVE_MPU=y
>>>>>>         CONFIG_ARCH_HAVE_RESET=y
>>>>>>         CONFIG_ARCH_HAVE_TESTSET=y
>>>>>>         CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
>>>>>>         CONFIG_ARCH_HAVE_BACKTRACE=y
>>>>>>         CONFIG_ARCH_HAVE_BOOTLOADER=y
>>>>>>         CONFIG_ARCH_HAVE_CPUINFO=y
>>>>>>         CONFIG_ARCH_FPU=y
>>>>>>         CONFIG_ARCH_STACKDUMP=y
>>>>>>         CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
>>>>>>         CONFIG_BOARD_LOOPSPERMSEC=16717
>>>>>>         CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
>>>>>>         CONFIG_ARCH_INTERRUPTSTACK=0
>>>>>>         CONFIG_BOOT_RUNFROMFLASH=y
>>>>>>         CONFIG_RAM_START=0x20000000
>>>>>>         CONFIG_RAM_SIZE=114688
>>>>>>         CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
>>>>>>         CONFIG_ARCH_HAVE_LEDS=y
>>>>>>         CONFIG_ARCH_HAVE_BUTTONS=y
>>>>>>         CONFIG_ARCH_BOARD_COMMON=y
>>>>>>         CONFIG_BOARDCTL=y
>>>>>>         CONFIG_BOARDCTL_MKRD=y
>>>>>>         CONFIG_DISABLE_OS_API=y
>>>>>>         CONFIG_USEC_PER_TICK=10000
>>>>>>         CONFIG_START_YEAR=2011
>>>>>>         CONFIG_START_MONTH=12
>>>>>>         CONFIG_START_DAY=6
>>>>>>         CONFIG_PREALLOC_TIMERS=4
>>>>>>         CONFIG_INIT_ENTRY=y
>>>>>>         CONFIG_INIT_ARGS=""
>>>>>>         CONFIG_INIT_STACKSIZE=2048
>>>>>>         CONFIG_INIT_PRIORITY=100
>>>>>>         CONFIG_INIT_ENTRYPOINT="nsh_main"
>>>>>>         CONFIG_INIT_ENTRYNAME="nsh_main"
>>>>>>         CONFIG_RR_INTERVAL=200
>>>>>>         CONFIG_TASK_NAME_SIZE=31
>>>>>>         CONFIG_SCHED_WAITPID=y
>>>>>>         CONFIG_PTHREAD_MUTEX_ROBUST=y
>>>>>>         CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
>>>>>>         CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
>>>>>>         CONFIG_DEV_CONSOLE=y
>>>>>>         CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
>>>>>>         CONFIG_FILE_STREAM=y
>>>>>>         CONFIG_NAME_MAX=32
>>>>>>         CONFIG_PATH_MAX=256
>>>>>>         CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
>>>>>>         CONFIG_PREALLOC_MQ_MSGS=8
>>>>>>         CONFIG_PREALLOC_MQ_IRQ_MSGS=8
>>>>>>         CONFIG_MQ_MAXMSGSIZE=32
>>>>>>         CONFIG_DEFAULT_TASK_STACKSIZE=2048
>>>>>>         CONFIG_IDLETHREAD_STACKSIZE=3072
>>>>>>         CONFIG_PTHREAD_STACK_MIN=256
>>>>>>         CONFIG_PTHREAD_STACK_DEFAULT=2048
>>>>>>         CONFIG_ARCH_HAVE_I2CRESET=y
>>>>>>         CONFIG_DEV_NULL=y
>>>>>>         CONFIG_DRVR_MKRD=y
>>>>>>         CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
>>>>>>         CONFIG_SERIAL=y
>>>>>>         CONFIG_SERIAL_CONSOLE=y
>>>>>>         CONFIG_MCU_SERIAL=y
>>>>>>         CONFIG_STANDARD_SERIAL=y
>>>>>>         CONFIG_SERIAL_NPOLLWAITERS=4
>>>>>>         CONFIG_UART0_SERIAL_CONSOLE=y
>>>>>>         CONFIG_UART0_SERIALDRIVER=y
>>>>>>         CONFIG_UART0_RXBUFSIZE=256
>>>>>>         CONFIG_UART0_TXBUFSIZE=256
>>>>>>         CONFIG_UART0_BAUD=115200
>>>>>>         CONFIG_UART0_BITS=8
>>>>>>         CONFIG_UART0_PARITY=0
>>>>>>         CONFIG_UART0_2STOP=0
>>>>>>         CONFIG_SYSLOG_MAX_CHANNELS=1
>>>>>>         CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
>>>>>>         CONFIG_SYSLOG_DEFAULT=y
>>>>>>         CONFIG_FS_NEPOLL_DESCRIPTORS=8
>>>>>>         CONFIG_SENDFILE_BUFSIZE=512
>>>>>>         CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
>>>>>>         CONFIG_FS_MQUEUE_NPOLLWAITERS=4
>>>>>>         CONFIG_FS_ANONMAP=y
>>>>>>         CONFIG_FS_PROCFS=y
>>>>>>         CONFIG_FS_PROCFS_MAX_TASKS=128
>>>>>>         CONFIG_NXFONTS_PACKEDMSFIRST=y
>>>>>>         CONFIG_MM_DEFAULT_MANAGER=y
>>>>>>         CONFIG_MM_DFAULT_ALIGNMENT=0
>>>>>>         CONFIG_MM_REGIONS=3
>>>>>>         CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
>>>>>>         CONFIG_MM_BACKTRACE=-1
>>>>>>         CONFIG_STDIO_BUFFER_SIZE=64
>>>>>>         CONFIG_STDIO_LINEBUFFER=y
>>>>>>         CONFIG_NUNGET_CHARS=2
>>>>>>         CONFIG_LIBC_FLOATINGPOINT=y
>>>>>>         CONFIG_LIBC_LONG_LONG=y
>>>>>>         CONFIG_ARCH_LOWPUTC=y
>>>>>>         CONFIG_LIBC_ARCH_ATOMIC=y
>>>>>>         CONFIG_LIBC_ARCH_MEMCHR=y
>>>>>>         CONFIG_LIBC_ARCH_MEMCPY=y
>>>>>>         CONFIG_LIBC_ARCH_MEMCMP=y
>>>>>>         CONFIG_LIBC_ARCH_MEMMOVE=y
>>>>>>         CONFIG_LIBC_ARCH_MEMSET=y
>>>>>>         CONFIG_LIBC_ARCH_STRCHR=y
>>>>>>         CONFIG_LIBC_ARCH_STRCMP=y
>>>>>>         CONFIG_LIBC_ARCH_STRCPY=y
>>>>>>         CONFIG_LIBC_ARCH_STRLCPY=y
>>>>>>         CONFIG_LIBC_ARCH_STRNCPY=y
>>>>>>         CONFIG_LIBC_ARCH_STRLEN=y
>>>>>>         CONFIG_LIBC_ARCH_STRNLEN=y
>>>>>>         CONFIG_LIBC_PREVENT_STRING_KERNEL=y
>>>>>>         CONFIG_LIBC_RAND_ORDER=1
>>>>>>         CONFIG_LIBC_HOMEDIR="/"
>>>>>>         CONFIG_LIBC_TMPDIR="/tmp"
>>>>>>         CONFIG_LIBC_MAX_TMPFILE=32
>>>>>>         CONFIG_LIBC_MAX_EXITFUNS=0
>>>>>>         CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
>>>>>>         CONFIG_LIBC_HOSTNAME=""
>>>>>>         CONFIG_LIBC_OPEN_MAX=256
>>>>>>         CONFIG_LIBC_STRERROR_ERRNUM=y
>>>>>>         CONFIG_LIBC_STRSIGNAL=y
>>>>>>         CONFIG_TLS_NELEM=4
>>>>>>         CONFIG_TLS_TASK_NELEM=0
>>>>>>         CONFIG_LIBC_GAISTRERROR_ERRNUM=y
>>>>>>         CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
>>>>>>         CONFIG_LIBC_MEMFD_ERROR=y
>>>>>>         CONFIG_BUILTIN=y
>>>>>>         CONFIG_STREAM_OUT_BUFFER_SIZE=64
>>>>>>         CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
>>>>>>         CONFIG_LIBM_TOOLCHAIN=y
>>>>>>         CONFIG_HAVE_CXX=y
>>>>>>         CONFIG_HAVE_CXXINITIALIZE=y
>>>>>>         CONFIG_LIBCXXMINI=y
>>>>>>         CONFIG_CXX_STANDARD="gnu++17"
>>>>>>         CONFIG_NSH_LIBRARY=y
>>>>>>         CONFIG_NSH_PROMPT_STRING="nsh> "
>>>>>>         CONFIG_NSH_READLINE=y
>>>>>>         CONFIG_NSH_LINELEN=64
>>>>>>         CONFIG_NSH_MAXARGUMENTS=7
>>>>>>         CONFIG_NSH_NESTDEPTH=3
>>>>>>         CONFIG_NSH_ALIAS=y
>>>>>>         CONFIG_NSH_ALIAS_MAX_AMOUNT=1
>>>>>>         CONFIG_NSH_BUILTIN_APPS=y
>>>>>>         CONFIG_NSH_DISABLE_DATE=y
>>>>>>         CONFIG_NSH_DISABLE_LOSMART=y
>>>>>>         CONFIG_NSH_DISABLE_LOMTD=y
>>>>>>         CONFIG_NSH_DISABLE_MB=y
>>>>>>         CONFIG_NSH_DISABLE_MH=y
>>>>>>         CONFIG_NSH_DISABLE_MW=y
>>>>>>         CONFIG_NSH_DISABLE_TIMEDATECTL=y
>>>>>>         CONFIG_NSH_CODECS_BUFSIZE=128
>>>>>>         CONFIG_NSH_PROC_MOUNTPOINT="/proc"
>>>>>>         CONFIG_NSH_FILEIOSIZE=512
>>>>>>         CONFIG_NSH_CONSOLE=y
>>>>>>         CONFIG_NSH_ARCHINIT=y
>>>>>>         CONFIG_SYSTEM_NSH=y
>>>>>>         CONFIG_SYSTEM_NSH_PRIORITY=100
>>>>>>         CONFIG_SYSTEM_NSH_STACKSIZE=2048
>>>>>>         CONFIG_SYSTEM_NSH_PROGNAME="nsh"
>>>>>>         CONFIG_SYSTEM_NXDIAG=y
>>>>>>         CONFIG_SYSTEM_NXDIAG_PRIORITY=100
>>>>>>         CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
>>>>>>         CONFIG_SYSTEM_NXDIAG_CONF=y
>>>>>>         CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
>>>>>>         CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
>>>>>>         CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
>>>>>>         CONFIG_SYSTEM_READLINE=y
>>>>>>         CONFIG_READLINE_HAVE_EXTMATCH=y
>>>>>>         CONFIG_READLINE_ECHO=y
>>>>>>
>>>>>> Host system OS:
>>>>>>         Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic
>> #26~22.04.1-Ubuntu
>>>>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
>>>>>>
>>>>>> Host system PATH:
>>>>>>         /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
>>>>>>         /home/mmoretti/bin
>>>>>>         /home/mmoretti/tools/bin
>>>>>>         /home/mmoretti/bin
>>>>>>         /home/mmoretti/tools/bin
>>>>>>         /home/mmoretti/.local/bin
>>>>>>         /usr/local/sbin
>>>>>>         /usr/local/bin
>>>>>>         /usr/sbin
>>>>>>         /usr/bin
>>>>>>         /sbin
>>>>>>         /bin
>>>>>>         /usr/games
>>>>>>         /usr/local/games
>>>>>>         /snap/bin
>>>>>>
>>>>>> Espressif specific information:
>>>>>>
>>>>>> Bootloader version:
>>>>>>         esp32: v5.1-dev-3972-g1559b6309f
>>>>>>         esp32s2: Bootloader image not found
>>>>>>         esp32s3: Bootloader image not found
>>>>>>         esp32c2: Bootloader image not found
>>>>>>         esp32c3: Bootloader image not found
>>>>>>         esp32c6: Bootloader image not found
>>>>>>         esp32h2: Bootloader image not found
>>>>>>
>>>>>> Toolchain version:
>>>>>>         clang: Not found
>>>>>>         gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
>>>>>>         xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
>>>>>> esp-12.2.0_20230208) 12.2.0
>>>>>>         xtensa-esp32s2-elf-gcc: Not found
>>>>>>         xtensa-esp32s3-elf-gcc: Not found
>>>>>>         riscv32-esp-elf-gcc: Not found
>>>>>>         riscv64-unknown-elf-gcc: Not found
>>>>>>
>>>>>> Esptool version: 4.6.2
>>>>>>
>>>>>> nsh>
>>>>>>
>>>>>>
>>>>>> -m
>>>>>>
>>>>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
>>>>>>> Hi Mike,
>>>>>>>
>>>>>>> We have been using NuttX on ESP32 for a while. The
>>>>>>> `esp32-devkitc:blewifi`
>>>>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS`
>> and
>>>>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running
>> it.
>>>>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run
>> the
>>>>>>> `nxdiag -all` from the NSH (please refer to
>>>>>>>
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>> ).
>>>>>>> Please share your results for reevaluation ;)
>>>>>>>
>>>>>>> Best regards,
>>>>>>>
>>>>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>
>>>>>>>> It appears that when using the blewifi configuration out of the box,
>>>>>>>> and
>>>>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION,
>> and
>>>>>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as
>> I've
>>>>>>>> gotten so far.  I'm still tweaking other configs to see if they
>> cause
>>>>>>>> hanging as well.
>>>>>>>>
>>>>>>>> This just does NOT appear to be a stable OS on the ESP32.
>>>>>>>>
>>>>>>>> -m
>>>>>>>>
>>>>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>>>>>>>> Hi!
>>>>>>>>>
>>>>>>>>> Good to know that! Yes, there are packages that need to be selected
>>>>>>>>> to
>>>>>>>> make
>>>>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>>>>>>>
>>>>>>>>> Please note that BLE's log is enabled with the other wireless logs
>>>>>>>> through
>>>>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this
>> helps
>>>>>>>>> debugging.
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>>
>>>>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps
>>>>>>>>>> and
>>>>>>>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>>>>>>>> configuration to work.  In my old tree, make distclean apparently
>>>>>>>>>> didn't
>>>>>>>>>> clean something, or my old tree was corrupt somehow.
>>>>>>>>>>
>>>>>>>>>> However, I still cannot get my own config to work (the one I
>>>>>>>>>> previously
>>>>>>>>>> attached).  There's a lot more stuff I need enabled than what is
>>>>>>>>>> enabled
>>>>>>>>>> by default in the blewifi configuration.  I guess I will just have
>>>>>>>>>> to
>>>>>>>>>> randomly keep modifying different config params until something
>>>>>>>>>> works.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> -m
>>>>>>>>>>
>>>>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>>>>>>>> Hi Mike,
>>>>>>>>>>>
>>>>>>>>>>> I found no trouble using the esp32-devkitc:blewifi configuration.
>>>>>>>>>>> May
>>>>>>>>>>> I
>>>>>>>>>> ask
>>>>>>>>>>> you to double-check your bootloader/partition-table
>> configuration?
>>>>>>>>>>> (you
>>>>>>>>>> can
>>>>>>>>>>> refer to
>>>>>>>>>>>
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>>>>>>>> ).
>>>>>>>>>>>
>>>>>>>>>>> If not successful yet, please do the following:
>>>>>>>>>>>
>>>>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag
>>>>>>>>>>> -all`
>>>>>>>>>>> from the NSH (please refer to
>>>>>>>>>>>
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>>>>>>>> ).
>>>>>>>>>>> Please share your results for reevaluattion ;)
>>>>>>>>>>>
>>>>>>>>>>> Best regards,
>>>>>>>>>>>
>>>>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>>>>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI
>> tests
>>>>>>>>>>>> all
>>>>>>>>>> the
>>>>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>>>>>>>
>>>>>>>>>>>> I'll check.
>>>>>>>>>>>>
>>>>>>>>>>>> Best regards,
>>>>>>>>>>>>
>>>>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>>>>>>>
>>>>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I
>> get
>>>>>>>>>> problems
>>>>>>>>>>>>> with it telling me there's no bootable app.
>>>>>>>>>>>>>
>>>>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and
>>>>>>>>>>>>> add
>>>>>>>>>> wifi
>>>>>>>>>>>>> and ble to it via menuconfig, I get only a little further.  It
>>>>>>>>>>>>> gets
>>>>>>>>>> past
>>>>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.
>>>>>>>>>>>>> With
>>>>>>>>>> all the
>>>>>>>>>>>>> ble options disabled and only wifi configured by itself it
>>>>>>>>>>>>> actually
>>>>>>>>>> boots
>>>>>>>>>>>>> into nsh after some time.  (At first, I had a somewhat similar
>>>>>>>>>>>>> issue
>>>>>>>>>> with
>>>>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't
>> defined
>>>>>>>>>>>>> in
>>>>>>>> the
>>>>>>>>>>>>> config file, where it would seem to hang and then finally show
>> a
>>>>>>>>>> prompt.
>>>>>>>>>>>>> It wasn't until I actually figured out about turning on
>>>>>>>>>>>>> CONFIG_DEBUG
>>>>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of
>> errors
>>>>>>>> during
>>>>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to just
>>>>>>>>>>>>> wait
>>>>>>>>>> for it
>>>>>>>>>>>>> a bit to show an nsh prompt.)
>>>>>>>>>>>>>
>>>>>>>>>>>>> However, there don't seem to be any config debug options for
>>>>>>>> bluetooth.
>>>>>>>>>>>>> I have no idea why it hangs as no messages are displayed and it
>>>>>>>>>>>>> never
>>>>>>>>>> shows
>>>>>>>>>>>>> a prompt even after a half an hour.  I've now spent hours
>> messing
>>>>>>>> with
>>>>>>>>>>>>> various BLE configuration options with no luck.  I'm including
>> my
>>>>>>>>>> config
>>>>>>>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>> -m
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Mike Moretti
>>>>>>>>>>>>> ♩♫♫♩♪♩
>>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Tiago Medicci Serrano
>>>>>>>>>>>>
>>>>>>>>>>>> Embedded Software Engineer
>>>>>>>>>>>> MSc Electronics/Microelectronics
>>>>>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>>>>>>>> e:tiago.medicci@gmail.com
>>>>>>>>>>>> a: Campinas, Brazil
>>>>>>>>>>>> Follow me:
>>>>>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>>>>>>>> <https://github.com/tmedicci>
>>>>>>>>>>>>
>>


Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Tiago Medicci Serrano <ti...@gmail.com>.
Hi!

Well, I was finally able to reproduce something similar to what you've
reported. When I switched to ` nuttx-12.2.1`, I was able to see the
NuttShell console indication but I wasn't able to type anything on it.

Could you please get nuttx from git e build from master?

I did the same and I applied the following patch to the `blewifi` defconfig:

```
diff --git a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
index c988cbc1d7..bb4db27b14 100644
--- a/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
+++ b/boards/xtensa/esp32/esp32-devkitc/configs/blewifi/defconfig
@@ -6,7 +6,6 @@
 # modifications.
 #
 # CONFIG_ARCH_LEDS is not set
-# CONFIG_NDEBUG is not set
 # CONFIG_NSH_ARGCAT is not set
 # CONFIG_NSH_CMDOPT_HEXDUMP is not set
 CONFIG_ALLOW_BSD_COMPONENTS=y
@@ -25,6 +24,16 @@ CONFIG_BOARDCTL_RESET=y
 CONFIG_BOARD_LOOPSPERMSEC=16717
 CONFIG_BTSAK=y
 CONFIG_BUILTIN=y
+CONFIG_DEBUG_ASSERTIONS=y
+CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
+CONFIG_DEBUG_ERROR=y
+CONFIG_DEBUG_FEATURES=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_WARN=y
+CONFIG_DEBUG_WIRELESS=y
+CONFIG_DEBUG_WIRELESS_ERROR=y
+CONFIG_DEBUG_WIRELESS_INFO=y
+CONFIG_DEBUG_WIRELESS_WARN=y
 CONFIG_DEFAULT_TASK_STACKSIZE=4096
 CONFIG_DEV_URANDOM=y
 CONFIG_DISABLE_MQUEUE_NOTIFICATION=y
@@ -32,6 +41,7 @@ CONFIG_DRIVERS_BLUETOOTH=y
 CONFIG_DRIVERS_IEEE80211=y
 CONFIG_DRIVERS_WIRELESS=y
 CONFIG_ESP32_BLE=y
+CONFIG_ESP32_MERGE_BINS=y
 CONFIG_ESP32_RT_TIMER_TASK_STACK_SIZE=4096
 CONFIG_ESP32_SPIFLASH=y
 CONFIG_ESP32_SPIFLASH_SPIFFS=y
```

`CONFIG_ESP32_MERGE_BINS` merges the bootloader and NuttX in a single
binary. Please download it from
https://drive.google.com/file/d/1poFsQpZ_SW7X_5FOHWYMVfAln3uBfO-S/view?usp=sharing
and try to flash it to your device (sha256:
40bcb3817eb3a0458161e35a2d08bbd663d7c16b197cdebe0cfeaa2529e8a684)

`esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 erase_flash && esptool.py -c
esp32 -p /dev/ttyUSB0 -b 921600 write_flash -fs detect -fm dio 0x0
nuttx.merged.bin && minicom -D /dev/ttyUSB0`

Tell me about your results. If it doesn't work, report me your console
results and run the following tests using the same `esptool.py`:

`esptool.py -c esp32 -p /dev/ttyUSB0 -b 921600 chip_id && esptool.py -c
esp32 -p /dev/ttyUSB0 -b 921600 flash_id`

Best regards,

Em sex., 1 de set. de 2023 às 11:26, Lucas Vaz
<lu...@espressif.com.invalid> escreveu:

> The make bootloader command, by default, downloads the most recent
> pre-compiled binaries. Downloading them manually can still be done as long
> as you make sure you are grabbing the most recent version. You can also
> build it (or MCUboot) from source by changing  the image configuration
> options in the menuconfig.
>
> Cheers,
> Lucas
> ________________________________
> From: Mike Moretti <nu...@mordent.com.INVALID>
> Sent: Friday, September 1, 2023 11:14
> To: dev@nuttx.apache.org <de...@nuttx.apache.org>
> Subject: Re: Adding bluetooth configuration on esp32 hangs nsh
>
> [External: This email originated outside Espressif]
>
> <irony>Wait, so you're telling me I should submit a PR, but you spent
> the time to document this on your own web site instead of submitting a
> PR to the official NuttX docs yourself?</irony> ;-)
>
> -m
>
> On 9/1/2023 10:02 AM, Alan C. Assis wrote:
> > Probably because we didn't update the documentation yet! :-)
> >
> > <irony> We're developers, we don't care about documentation...
> > documentation is for wimps! </irony>
> >
> > Of course we need to improve our documentation! This is why all new PR
> > introducing some new feature I insist to people include documentation.
> >
> > Please consider submitting a patch fixing it.
> >
> > BR,
> >
> > Alan
> >
> > On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
> >> Wait, so, the NuttX docs say to just download the bootloader/partitions
> >> from some link.  If we have to make the bootloader ourselves why isn't
> >> that part of the NuttX official documentation?
> >>
> >> -m
> >>
> >> On 9/1/2023 9:13 AM, Alan C. Assis wrote:
> >>> Hi Mike,
> >>>
> >>> Please sure you are using the right bootloader too:
> >>>
> >>>
> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
> >>>
> >>> BR,
> >>>
> >>> Alan
> >>>
> >>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
> >>>> Hi,
> >>>>
> >>>> So, just to be sure, I made a completely fresh directory, untarred the
> >>>> 12.2.1 tarballs into it, did ./tools/configure.sh
> esp32-devkitc:blewifi,
> >>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then
> >>>> flashed.  It boots to nsh but then doesn't accept any input; it's
> hung.
> >>>> If I have my wifi credentials in the config, so many messages come
> out I
> >>>> can't tell if it displayed the nsh prompt, but the last thing I see
> >>>> before it hangs and doesn't accept any input is some message about
> wifi
> >>>> (I'm assuming it connected).
> >>>>
> >>>> I then tried, after yet another rm+untar (yes, I'm removing both nuttx
> >>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag,
> but
> >>>> it wouldn't build.
> >>>>
> >>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04
> LTS)
> >>>> for other projects, I've just been use the toolchain that comes with
> it
> >>>> instead of the "latest" one recommend via the NuttX docs link.
> >>>> Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4
> vs
> >>>> gcc-12.2).
> >>>>
> >>>> So I installed the newer toolchain and esptool.py as directed by the
> >>>> NuttX documentation.  I then opened a new shell without running the
> >>>> ESP-IDF environment setup script, manually set my path to include the
> >>>> new toolchain, and tried again.  However, after yet another rm+untar
> and
> >>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I still
> >>>> get the same problem with it hanging.
> >>>>
> >>>> But luckily, with the newer toolchain, I'm at least able to build and
> >>>> run nxdiag and here is the output:
> >>>>
> >>>> nxdiag --all
> >>>> Nxdiag Report:
> >>>>
> >>>> NuttX RTOS info:
> >>>>        Hostname:
> >>>>        Release: 12.2.1
> >>>>        Build: 148c631a2d Sep  1 2023 08:45:59
> >>>>        Arch: xtensa
> >>>>        Defconfig: esp32-devkitc:nxdiag
> >>>>
> >>>> NuttX CFLAGS:
> >>>>        -fno-common
> >>>>        -Wall
> >>>>        -Wstrict-prototypes
> >>>>        -Wshadow
> >>>>        -Wundef
> >>>>        -Os
> >>>>        -fno-strict-aliasing
> >>>>        -fomit-frame-pointer
> >>>>        -ffunction-sections
> >>>>        -fdata-sections
> >>>>        -mlongcalls
> >>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
> >>>>        -D__NuttX__
> >>>>        -DNDEBUG
> >>>>        -pipe
> >>>>        -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
> >>>>
> >>>> NuttX CXXFLAGS:
> >>>>        -fno-common
> >>>>        -nostdinc++
> >>>>        -Wall
> >>>>        -Wshadow
> >>>>        -Wundef
> >>>>        -std="gnu++17"
> >>>>        -fno-exceptions
> >>>>        -fcheck-new
> >>>>        -fno-rtti
> >>>>        -Os
> >>>>        -fno-strict-aliasing
> >>>>        -fomit-frame-pointer
> >>>>        -ffunction-sections
> >>>>        -fdata-sections
> >>>>        -mlongcalls
> >>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
> >>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
> >>>>        -D__NuttX__
> >>>>        -DNDEBUG
> >>>>        -pipe
> >>>>        -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
> >>>>
> >>>> NuttX LDFLAGS:
> >>>>        -nostdlib
> >>>>        --gc-sections
> >>>>        --cref
> >>>>        -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
> >>>>
> >>>> NuttX configuration options:
> >>>>        CONFIG_HOST_LINUX=y
> >>>>        CONFIG_APPS_DIR="../apps"
> >>>>        CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
> >>>>        CONFIG_BUILD_FLAT=y
> >>>>        CONFIG_INTELHEX_BINARY=y
> >>>>        CONFIG_ARCH_HAVE_STDARG_H=y
> >>>>        CONFIG_ARCH_HAVE_SETJMP=y
> >>>>        CONFIG_ARCH_NONE_DEBUG_H=y
> >>>>        CONFIG_FORTIFY_SOURCE=0
> >>>>        CONFIG_NDEBUG=y
> >>>>        CONFIG_DEBUG_ALERT=y
> >>>>        CONFIG_ARCH_HAVE_STACKCHECK=y
> >>>>        CONFIG_ARCH_HAVE_CUSTOMOPT=y
> >>>>        CONFIG_DEBUG_FULLOPT=y
> >>>>        CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
> >>>>        CONFIG_DEBUG_LINK_MAP=y
> >>>>        CONFIG_ARCH_XTENSA=y
> >>>>        CONFIG_ARCH="xtensa"
> >>>>        CONFIG_ARCH_CHIP="esp32"
> >>>>        CONFIG_ARCH_BOARD="esp32-devkitc"
> >>>>        CONFIG_ARCH_CHIP_ESP32=y
> >>>>        CONFIG_ARCH_FAMILY_LX6=y
> >>>>        CONFIG_XTENSA_CP_INITSET=0x0001
> >>>>        CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
> >>>>        CONFIG_XTENSA_BTDEPTH=50
> >>>>        CONFIG_XTENSA_TOOLCHAIN_ESP=y
> >>>>        CONFIG_ARCH_CHIP_ESP32WROVER=y
> >>>>        CONFIG_ESP32_DUAL_CPU=y
> >>>>        CONFIG_ESP32_FLASH_4M=y
> >>>>        CONFIG_ESP32_FLASH_DETECT=y
> >>>>        CONFIG_ESP32_PSRAM_8M=y
> >>>>        CONFIG_ESP32_ESP32DXWDXX=y
> >>>>        CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
> >>>>        CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
> >>>>        CONFIG_ESP32_XTAL_40MZ=y
> >>>>        CONFIG_ESP32_UART=y
> >>>>        CONFIG_ESP32_RTC=y
> >>>>        CONFIG_ESP32_UART0=y
> >>>>        CONFIG_ESP32_BT_RESERVE_DRAM=0
> >>>>        CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
> >>>>        CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
> >>>>        CONFIG_ESP32_UART0_TXPIN=1
> >>>>        CONFIG_ESP32_UART0_RXPIN=3
> >>>>        CONFIG_ESP32_FLASH_MODE_DIO=y
> >>>>        CONFIG_ESP32_FLASH_FREQ_40M=y
> >>>>        CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
> >>>>        CONFIG_ESP32_APP_FORMAT_LEGACY=y
> >>>>        CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
> >>>>        CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
> >>>>        CONFIG_ARCH_TOOLCHAIN_GNU=y
> >>>>        CONFIG_LTO_NONE=y
> >>>>        CONFIG_ARCH_VECNOTIRQ=y
> >>>>        CONFIG_ARCH_HAVE_TEXT_HEAP=y
> >>>>        CONFIG_ARCH_HAVE_MULTICPU=y
> >>>>        CONFIG_ARCH_HAVE_FPU=y
> >>>>        CONFIG_ARCH_HAVE_MPU=y
> >>>>        CONFIG_ARCH_HAVE_RESET=y
> >>>>        CONFIG_ARCH_HAVE_TESTSET=y
> >>>>        CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
> >>>>        CONFIG_ARCH_HAVE_BACKTRACE=y
> >>>>        CONFIG_ARCH_HAVE_BOOTLOADER=y
> >>>>        CONFIG_ARCH_HAVE_CPUINFO=y
> >>>>        CONFIG_ARCH_FPU=y
> >>>>        CONFIG_ARCH_STACKDUMP=y
> >>>>        CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
> >>>>        CONFIG_BOARD_LOOPSPERMSEC=16717
> >>>>        CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
> >>>>        CONFIG_ARCH_INTERRUPTSTACK=0
> >>>>        CONFIG_BOOT_RUNFROMFLASH=y
> >>>>        CONFIG_RAM_START=0x20000000
> >>>>        CONFIG_RAM_SIZE=114688
> >>>>        CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
> >>>>        CONFIG_ARCH_HAVE_LEDS=y
> >>>>        CONFIG_ARCH_HAVE_BUTTONS=y
> >>>>        CONFIG_ARCH_BOARD_COMMON=y
> >>>>        CONFIG_BOARDCTL=y
> >>>>        CONFIG_BOARDCTL_MKRD=y
> >>>>        CONFIG_DISABLE_OS_API=y
> >>>>        CONFIG_USEC_PER_TICK=10000
> >>>>        CONFIG_START_YEAR=2011
> >>>>        CONFIG_START_MONTH=12
> >>>>        CONFIG_START_DAY=6
> >>>>        CONFIG_PREALLOC_TIMERS=4
> >>>>        CONFIG_INIT_ENTRY=y
> >>>>        CONFIG_INIT_ARGS=""
> >>>>        CONFIG_INIT_STACKSIZE=2048
> >>>>        CONFIG_INIT_PRIORITY=100
> >>>>        CONFIG_INIT_ENTRYPOINT="nsh_main"
> >>>>        CONFIG_INIT_ENTRYNAME="nsh_main"
> >>>>        CONFIG_RR_INTERVAL=200
> >>>>        CONFIG_TASK_NAME_SIZE=31
> >>>>        CONFIG_SCHED_WAITPID=y
> >>>>        CONFIG_PTHREAD_MUTEX_ROBUST=y
> >>>>        CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
> >>>>        CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
> >>>>        CONFIG_DEV_CONSOLE=y
> >>>>        CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
> >>>>        CONFIG_FILE_STREAM=y
> >>>>        CONFIG_NAME_MAX=32
> >>>>        CONFIG_PATH_MAX=256
> >>>>        CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
> >>>>        CONFIG_PREALLOC_MQ_MSGS=8
> >>>>        CONFIG_PREALLOC_MQ_IRQ_MSGS=8
> >>>>        CONFIG_MQ_MAXMSGSIZE=32
> >>>>        CONFIG_DEFAULT_TASK_STACKSIZE=2048
> >>>>        CONFIG_IDLETHREAD_STACKSIZE=3072
> >>>>        CONFIG_PTHREAD_STACK_MIN=256
> >>>>        CONFIG_PTHREAD_STACK_DEFAULT=2048
> >>>>        CONFIG_ARCH_HAVE_I2CRESET=y
> >>>>        CONFIG_DEV_NULL=y
> >>>>        CONFIG_DRVR_MKRD=y
> >>>>        CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
> >>>>        CONFIG_SERIAL=y
> >>>>        CONFIG_SERIAL_CONSOLE=y
> >>>>        CONFIG_MCU_SERIAL=y
> >>>>        CONFIG_STANDARD_SERIAL=y
> >>>>        CONFIG_SERIAL_NPOLLWAITERS=4
> >>>>        CONFIG_UART0_SERIAL_CONSOLE=y
> >>>>        CONFIG_UART0_SERIALDRIVER=y
> >>>>        CONFIG_UART0_RXBUFSIZE=256
> >>>>        CONFIG_UART0_TXBUFSIZE=256
> >>>>        CONFIG_UART0_BAUD=115200
> >>>>        CONFIG_UART0_BITS=8
> >>>>        CONFIG_UART0_PARITY=0
> >>>>        CONFIG_UART0_2STOP=0
> >>>>        CONFIG_SYSLOG_MAX_CHANNELS=1
> >>>>        CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
> >>>>        CONFIG_SYSLOG_DEFAULT=y
> >>>>        CONFIG_FS_NEPOLL_DESCRIPTORS=8
> >>>>        CONFIG_SENDFILE_BUFSIZE=512
> >>>>        CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
> >>>>        CONFIG_FS_MQUEUE_NPOLLWAITERS=4
> >>>>        CONFIG_FS_ANONMAP=y
> >>>>        CONFIG_FS_PROCFS=y
> >>>>        CONFIG_FS_PROCFS_MAX_TASKS=128
> >>>>        CONFIG_NXFONTS_PACKEDMSFIRST=y
> >>>>        CONFIG_MM_DEFAULT_MANAGER=y
> >>>>        CONFIG_MM_DFAULT_ALIGNMENT=0
> >>>>        CONFIG_MM_REGIONS=3
> >>>>        CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
> >>>>        CONFIG_MM_BACKTRACE=-1
> >>>>        CONFIG_STDIO_BUFFER_SIZE=64
> >>>>        CONFIG_STDIO_LINEBUFFER=y
> >>>>        CONFIG_NUNGET_CHARS=2
> >>>>        CONFIG_LIBC_FLOATINGPOINT=y
> >>>>        CONFIG_LIBC_LONG_LONG=y
> >>>>        CONFIG_ARCH_LOWPUTC=y
> >>>>        CONFIG_LIBC_ARCH_ATOMIC=y
> >>>>        CONFIG_LIBC_ARCH_MEMCHR=y
> >>>>        CONFIG_LIBC_ARCH_MEMCPY=y
> >>>>        CONFIG_LIBC_ARCH_MEMCMP=y
> >>>>        CONFIG_LIBC_ARCH_MEMMOVE=y
> >>>>        CONFIG_LIBC_ARCH_MEMSET=y
> >>>>        CONFIG_LIBC_ARCH_STRCHR=y
> >>>>        CONFIG_LIBC_ARCH_STRCMP=y
> >>>>        CONFIG_LIBC_ARCH_STRCPY=y
> >>>>        CONFIG_LIBC_ARCH_STRLCPY=y
> >>>>        CONFIG_LIBC_ARCH_STRNCPY=y
> >>>>        CONFIG_LIBC_ARCH_STRLEN=y
> >>>>        CONFIG_LIBC_ARCH_STRNLEN=y
> >>>>        CONFIG_LIBC_PREVENT_STRING_KERNEL=y
> >>>>        CONFIG_LIBC_RAND_ORDER=1
> >>>>        CONFIG_LIBC_HOMEDIR="/"
> >>>>        CONFIG_LIBC_TMPDIR="/tmp"
> >>>>        CONFIG_LIBC_MAX_TMPFILE=32
> >>>>        CONFIG_LIBC_MAX_EXITFUNS=0
> >>>>        CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
> >>>>        CONFIG_LIBC_HOSTNAME=""
> >>>>        CONFIG_LIBC_OPEN_MAX=256
> >>>>        CONFIG_LIBC_STRERROR_ERRNUM=y
> >>>>        CONFIG_LIBC_STRSIGNAL=y
> >>>>        CONFIG_TLS_NELEM=4
> >>>>        CONFIG_TLS_TASK_NELEM=0
> >>>>        CONFIG_LIBC_GAISTRERROR_ERRNUM=y
> >>>>        CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
> >>>>        CONFIG_LIBC_MEMFD_ERROR=y
> >>>>        CONFIG_BUILTIN=y
> >>>>        CONFIG_STREAM_OUT_BUFFER_SIZE=64
> >>>>        CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
> >>>>        CONFIG_LIBM_TOOLCHAIN=y
> >>>>        CONFIG_HAVE_CXX=y
> >>>>        CONFIG_HAVE_CXXINITIALIZE=y
> >>>>        CONFIG_LIBCXXMINI=y
> >>>>        CONFIG_CXX_STANDARD="gnu++17"
> >>>>        CONFIG_NSH_LIBRARY=y
> >>>>        CONFIG_NSH_PROMPT_STRING="nsh> "
> >>>>        CONFIG_NSH_READLINE=y
> >>>>        CONFIG_NSH_LINELEN=64
> >>>>        CONFIG_NSH_MAXARGUMENTS=7
> >>>>        CONFIG_NSH_NESTDEPTH=3
> >>>>        CONFIG_NSH_ALIAS=y
> >>>>        CONFIG_NSH_ALIAS_MAX_AMOUNT=1
> >>>>        CONFIG_NSH_BUILTIN_APPS=y
> >>>>        CONFIG_NSH_DISABLE_DATE=y
> >>>>        CONFIG_NSH_DISABLE_LOSMART=y
> >>>>        CONFIG_NSH_DISABLE_LOMTD=y
> >>>>        CONFIG_NSH_DISABLE_MB=y
> >>>>        CONFIG_NSH_DISABLE_MH=y
> >>>>        CONFIG_NSH_DISABLE_MW=y
> >>>>        CONFIG_NSH_DISABLE_TIMEDATECTL=y
> >>>>        CONFIG_NSH_CODECS_BUFSIZE=128
> >>>>        CONFIG_NSH_PROC_MOUNTPOINT="/proc"
> >>>>        CONFIG_NSH_FILEIOSIZE=512
> >>>>        CONFIG_NSH_CONSOLE=y
> >>>>        CONFIG_NSH_ARCHINIT=y
> >>>>        CONFIG_SYSTEM_NSH=y
> >>>>        CONFIG_SYSTEM_NSH_PRIORITY=100
> >>>>        CONFIG_SYSTEM_NSH_STACKSIZE=2048
> >>>>        CONFIG_SYSTEM_NSH_PROGNAME="nsh"
> >>>>        CONFIG_SYSTEM_NXDIAG=y
> >>>>        CONFIG_SYSTEM_NXDIAG_PRIORITY=100
> >>>>        CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
> >>>>        CONFIG_SYSTEM_NXDIAG_CONF=y
> >>>>        CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
> >>>>        CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
> >>>>        CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
> >>>>        CONFIG_SYSTEM_READLINE=y
> >>>>        CONFIG_READLINE_HAVE_EXTMATCH=y
> >>>>        CONFIG_READLINE_ECHO=y
> >>>>
> >>>> Host system OS:
> >>>>        Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic
> #26~22.04.1-Ubuntu
> >>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
> >>>>
> >>>> Host system PATH:
> >>>>        /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
> >>>>        /home/mmoretti/bin
> >>>>        /home/mmoretti/tools/bin
> >>>>        /home/mmoretti/bin
> >>>>        /home/mmoretti/tools/bin
> >>>>        /home/mmoretti/.local/bin
> >>>>        /usr/local/sbin
> >>>>        /usr/local/bin
> >>>>        /usr/sbin
> >>>>        /usr/bin
> >>>>        /sbin
> >>>>        /bin
> >>>>        /usr/games
> >>>>        /usr/local/games
> >>>>        /snap/bin
> >>>>
> >>>> Espressif specific information:
> >>>>
> >>>> Bootloader version:
> >>>>        esp32: v5.1-dev-3972-g1559b6309f
> >>>>        esp32s2: Bootloader image not found
> >>>>        esp32s3: Bootloader image not found
> >>>>        esp32c2: Bootloader image not found
> >>>>        esp32c3: Bootloader image not found
> >>>>        esp32c6: Bootloader image not found
> >>>>        esp32h2: Bootloader image not found
> >>>>
> >>>> Toolchain version:
> >>>>        clang: Not found
> >>>>        gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
> >>>>        xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
> >>>> esp-12.2.0_20230208) 12.2.0
> >>>>        xtensa-esp32s2-elf-gcc: Not found
> >>>>        xtensa-esp32s3-elf-gcc: Not found
> >>>>        riscv32-esp-elf-gcc: Not found
> >>>>        riscv64-unknown-elf-gcc: Not found
> >>>>
> >>>> Esptool version: 4.6.2
> >>>>
> >>>> nsh>
> >>>>
> >>>>
> >>>> -m
> >>>>
> >>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
> >>>>> Hi Mike,
> >>>>>
> >>>>> We have been using NuttX on ESP32 for a while. The
> >>>>> `esp32-devkitc:blewifi`
> >>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS`
> and
> >>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running
> it.
> >>>>>
> >>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run
> the
> >>>>> `nxdiag -all` from the NSH (please refer to
> >>>>>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
> ).
> >>>>> Please share your results for reevaluation ;)
> >>>>>
> >>>>> Best regards,
> >>>>>
> >>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
> >>>>> <nu...@mordent.com.invalid>  escreveu:
> >>>>>
> >>>>>> It appears that when using the blewifi configuration out of the box,
> >>>>>> and
> >>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION,
> and
> >>>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as
> I've
> >>>>>> gotten so far.  I'm still tweaking other configs to see if they
> cause
> >>>>>> hanging as well.
> >>>>>>
> >>>>>> This just does NOT appear to be a stable OS on the ESP32.
> >>>>>>
> >>>>>> -m
> >>>>>>
> >>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
> >>>>>>> Hi!
> >>>>>>>
> >>>>>>> Good to know that! Yes, there are packages that need to be selected
> >>>>>>> to
> >>>>>> make
> >>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
> >>>>>>>
> >>>>>>> Please note that BLE's log is enabled with the other wireless logs
> >>>>>> through
> >>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this
> helps
> >>>>>>> debugging.
> >>>>>>>
> >>>>>>> Best regards,
> >>>>>>>
> >>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
> >>>>>>> <nu...@mordent.com.invalid>  escreveu:
> >>>>>>>
> >>>>>>>> Hi,
> >>>>>>>>
> >>>>>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps
> >>>>>>>> and
> >>>>>>>> ran tools/configure.sh with blewifi that I was able to get that
> >>>>>>>> configuration to work.  In my old tree, make distclean apparently
> >>>>>>>> didn't
> >>>>>>>> clean something, or my old tree was corrupt somehow.
> >>>>>>>>
> >>>>>>>> However, I still cannot get my own config to work (the one I
> >>>>>>>> previously
> >>>>>>>> attached).  There's a lot more stuff I need enabled than what is
> >>>>>>>> enabled
> >>>>>>>> by default in the blewifi configuration.  I guess I will just have
> >>>>>>>> to
> >>>>>>>> randomly keep modifying different config params until something
> >>>>>>>> works.
> >>>>>>>>
> >>>>>>>> Thanks,
> >>>>>>>> -m
> >>>>>>>>
> >>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
> >>>>>>>>> Hi Mike,
> >>>>>>>>>
> >>>>>>>>> I found no trouble using the esp32-devkitc:blewifi configuration.
> >>>>>>>>> May
> >>>>>>>>> I
> >>>>>>>> ask
> >>>>>>>>> you to double-check your bootloader/partition-table
> configuration?
> >>>>>>>>> (you
> >>>>>>>> can
> >>>>>>>>> refer to
> >>>>>>>>>
> >>>>>>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
> >>>>>>>>> ).
> >>>>>>>>>
> >>>>>>>>> If not successful yet, please do the following:
> >>>>>>>>>
> >>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag
> >>>>>>>>> -all`
> >>>>>>>>> from the NSH (please refer to
> >>>>>>>>>
> >>>>>>
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
> >>>>>>>> ).
> >>>>>>>>> Please share your results for reevaluattion ;)
> >>>>>>>>>
> >>>>>>>>> Best regards,
> >>>>>>>>>
> >>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
> >>>>>>>>> tiago.medicci@gmail.com> escreveu:
> >>>>>>>>>
> >>>>>>>>>> Hi,
> >>>>>>>>>>
> >>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI
> tests
> >>>>>>>>>> all
> >>>>>>>> the
> >>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
> >>>>>>>>>>
> >>>>>>>>>> I'll check.
> >>>>>>>>>>
> >>>>>>>>>> Best regards,
> >>>>>>>>>>
> >>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
> >>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
> >>>>>>>>>>
> >>>>>>>>>>> Hi,
> >>>>>>>>>>>
> >>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
> >>>>>>>>>>>
> >>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
> >>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I
> get
> >>>>>>>> problems
> >>>>>>>>>>> with it telling me there's no bootable app.
> >>>>>>>>>>>
> >>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and
> >>>>>>>>>>> add
> >>>>>>>> wifi
> >>>>>>>>>>> and ble to it via menuconfig, I get only a little further.  It
> >>>>>>>>>>> gets
> >>>>>>>> past
> >>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.
> >>>>>>>>>>> With
> >>>>>>>> all the
> >>>>>>>>>>> ble options disabled and only wifi configured by itself it
> >>>>>>>>>>> actually
> >>>>>>>> boots
> >>>>>>>>>>> into nsh after some time.  (At first, I had a somewhat similar
> >>>>>>>>>>> issue
> >>>>>>>> with
> >>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't
> defined
> >>>>>>>>>>> in
> >>>>>> the
> >>>>>>>>>>> config file, where it would seem to hang and then finally show
> a
> >>>>>>>> prompt.
> >>>>>>>>>>> It wasn't until I actually figured out about turning on
> >>>>>>>>>>> CONFIG_DEBUG
> >>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of
> errors
> >>>>>> during
> >>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to just
> >>>>>>>>>>> wait
> >>>>>>>> for it
> >>>>>>>>>>> a bit to show an nsh prompt.)
> >>>>>>>>>>>
> >>>>>>>>>>> However, there don't seem to be any config debug options for
> >>>>>> bluetooth.
> >>>>>>>>>>> I have no idea why it hangs as no messages are displayed and it
> >>>>>>>>>>> never
> >>>>>>>> shows
> >>>>>>>>>>> a prompt even after a half an hour.  I've now spent hours
> messing
> >>>>>> with
> >>>>>>>>>>> various BLE configuration options with no luck.  I'm including
> my
> >>>>>>>> config
> >>>>>>>>>>> file in hope that someone might see something wrong with it.
> >>>>>>>>>>>
> >>>>>>>>>>> Thanks,
> >>>>>>>>>>> -m
> >>>>>>>>>>> --
> >>>>>>>>>>> Mike Moretti
> >>>>>>>>>>> ♩♫♫♩♪♩
> >>>>>>>>>>>
> >>>>>>>>>> --
> >>>>>>>>>> Tiago Medicci Serrano
> >>>>>>>>>>
> >>>>>>>>>> Embedded Software Engineer
> >>>>>>>>>> MSc Electronics/Microelectronics
> >>>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
> >>>>>>>>>> e:tiago.medicci@gmail.com
> >>>>>>>>>> a: Campinas, Brazil
> >>>>>>>>>> Follow me:
> >>>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
> >>>>>>>>>> <https://github.com/tmedicci>
> >>>>>>>>>>
> >>
>
>

-- 
Tiago Medicci Serrano

Embedded Software Engineer
MSc Electronics/Microelectronics
m: +55 (19) 981403886 <+55+(19)+981403886>
e: tiago.medicci@gmail.com
a: Campinas, Brazil
Follow me:
<https://www.linkedin.com/in/tiago-serrano-924458b6>
<https://github.com/tmedicci>

Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Lucas Vaz <lu...@espressif.com.INVALID>.
The make bootloader command, by default, downloads the most recent pre-compiled binaries. Downloading them manually can still be done as long as you make sure you are grabbing the most recent version. You can also build it (or MCUboot) from source by changing  the image configuration options in the menuconfig.

Cheers,
Lucas
________________________________
From: Mike Moretti <nu...@mordent.com.INVALID>
Sent: Friday, September 1, 2023 11:14
To: dev@nuttx.apache.org <de...@nuttx.apache.org>
Subject: Re: Adding bluetooth configuration on esp32 hangs nsh

[External: This email originated outside Espressif]

<irony>Wait, so you're telling me I should submit a PR, but you spent
the time to document this on your own web site instead of submitting a
PR to the official NuttX docs yourself?</irony> ;-)

-m

On 9/1/2023 10:02 AM, Alan C. Assis wrote:
> Probably because we didn't update the documentation yet! :-)
>
> <irony> We're developers, we don't care about documentation...
> documentation is for wimps! </irony>
>
> Of course we need to improve our documentation! This is why all new PR
> introducing some new feature I insist to people include documentation.
>
> Please consider submitting a patch fixing it.
>
> BR,
>
> Alan
>
> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>> Wait, so, the NuttX docs say to just download the bootloader/partitions
>> from some link.  If we have to make the bootloader ourselves why isn't
>> that part of the NuttX official documentation?
>>
>> -m
>>
>> On 9/1/2023 9:13 AM, Alan C. Assis wrote:
>>> Hi Mike,
>>>
>>> Please sure you are using the right bootloader too:
>>>
>>> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
>>>
>>> BR,
>>>
>>> Alan
>>>
>>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>>> Hi,
>>>>
>>>> So, just to be sure, I made a completely fresh directory, untarred the
>>>> 12.2.1 tarballs into it, did ./tools/configure.sh esp32-devkitc:blewifi,
>>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then
>>>> flashed.  It boots to nsh but then doesn't accept any input; it's hung.
>>>> If I have my wifi credentials in the config, so many messages come out I
>>>> can't tell if it displayed the nsh prompt, but the last thing I see
>>>> before it hangs and doesn't accept any input is some message about wifi
>>>> (I'm assuming it connected).
>>>>
>>>> I then tried, after yet another rm+untar (yes, I'm removing both nuttx
>>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag, but
>>>> it wouldn't build.
>>>>
>>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04 LTS)
>>>> for other projects, I've just been use the toolchain that comes with it
>>>> instead of the "latest" one recommend via the NuttX docs link.
>>>> Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4 vs
>>>> gcc-12.2).
>>>>
>>>> So I installed the newer toolchain and esptool.py as directed by the
>>>> NuttX documentation.  I then opened a new shell without running the
>>>> ESP-IDF environment setup script, manually set my path to include the
>>>> new toolchain, and tried again.  However, after yet another rm+untar and
>>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I still
>>>> get the same problem with it hanging.
>>>>
>>>> But luckily, with the newer toolchain, I'm at least able to build and
>>>> run nxdiag and here is the output:
>>>>
>>>> nxdiag --all
>>>> Nxdiag Report:
>>>>
>>>> NuttX RTOS info:
>>>>        Hostname:
>>>>        Release: 12.2.1
>>>>        Build: 148c631a2d Sep  1 2023 08:45:59
>>>>        Arch: xtensa
>>>>        Defconfig: esp32-devkitc:nxdiag
>>>>
>>>> NuttX CFLAGS:
>>>>        -fno-common
>>>>        -Wall
>>>>        -Wstrict-prototypes
>>>>        -Wshadow
>>>>        -Wundef
>>>>        -Os
>>>>        -fno-strict-aliasing
>>>>        -fomit-frame-pointer
>>>>        -ffunction-sections
>>>>        -fdata-sections
>>>>        -mlongcalls
>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>        -D__NuttX__
>>>>        -DNDEBUG
>>>>        -pipe
>>>>        -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>
>>>> NuttX CXXFLAGS:
>>>>        -fno-common
>>>>        -nostdinc++
>>>>        -Wall
>>>>        -Wshadow
>>>>        -Wundef
>>>>        -std="gnu++17"
>>>>        -fno-exceptions
>>>>        -fcheck-new
>>>>        -fno-rtti
>>>>        -Os
>>>>        -fno-strict-aliasing
>>>>        -fomit-frame-pointer
>>>>        -ffunction-sections
>>>>        -fdata-sections
>>>>        -mlongcalls
>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>        -D__NuttX__
>>>>        -DNDEBUG
>>>>        -pipe
>>>>        -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>
>>>> NuttX LDFLAGS:
>>>>        -nostdlib
>>>>        --gc-sections
>>>>        --cref
>>>>        -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
>>>>
>>>> NuttX configuration options:
>>>>        CONFIG_HOST_LINUX=y
>>>>        CONFIG_APPS_DIR="../apps"
>>>>        CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
>>>>        CONFIG_BUILD_FLAT=y
>>>>        CONFIG_INTELHEX_BINARY=y
>>>>        CONFIG_ARCH_HAVE_STDARG_H=y
>>>>        CONFIG_ARCH_HAVE_SETJMP=y
>>>>        CONFIG_ARCH_NONE_DEBUG_H=y
>>>>        CONFIG_FORTIFY_SOURCE=0
>>>>        CONFIG_NDEBUG=y
>>>>        CONFIG_DEBUG_ALERT=y
>>>>        CONFIG_ARCH_HAVE_STACKCHECK=y
>>>>        CONFIG_ARCH_HAVE_CUSTOMOPT=y
>>>>        CONFIG_DEBUG_FULLOPT=y
>>>>        CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
>>>>        CONFIG_DEBUG_LINK_MAP=y
>>>>        CONFIG_ARCH_XTENSA=y
>>>>        CONFIG_ARCH="xtensa"
>>>>        CONFIG_ARCH_CHIP="esp32"
>>>>        CONFIG_ARCH_BOARD="esp32-devkitc"
>>>>        CONFIG_ARCH_CHIP_ESP32=y
>>>>        CONFIG_ARCH_FAMILY_LX6=y
>>>>        CONFIG_XTENSA_CP_INITSET=0x0001
>>>>        CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
>>>>        CONFIG_XTENSA_BTDEPTH=50
>>>>        CONFIG_XTENSA_TOOLCHAIN_ESP=y
>>>>        CONFIG_ARCH_CHIP_ESP32WROVER=y
>>>>        CONFIG_ESP32_DUAL_CPU=y
>>>>        CONFIG_ESP32_FLASH_4M=y
>>>>        CONFIG_ESP32_FLASH_DETECT=y
>>>>        CONFIG_ESP32_PSRAM_8M=y
>>>>        CONFIG_ESP32_ESP32DXWDXX=y
>>>>        CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
>>>>        CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
>>>>        CONFIG_ESP32_XTAL_40MZ=y
>>>>        CONFIG_ESP32_UART=y
>>>>        CONFIG_ESP32_RTC=y
>>>>        CONFIG_ESP32_UART0=y
>>>>        CONFIG_ESP32_BT_RESERVE_DRAM=0
>>>>        CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
>>>>        CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
>>>>        CONFIG_ESP32_UART0_TXPIN=1
>>>>        CONFIG_ESP32_UART0_RXPIN=3
>>>>        CONFIG_ESP32_FLASH_MODE_DIO=y
>>>>        CONFIG_ESP32_FLASH_FREQ_40M=y
>>>>        CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
>>>>        CONFIG_ESP32_APP_FORMAT_LEGACY=y
>>>>        CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
>>>>        CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
>>>>        CONFIG_ARCH_TOOLCHAIN_GNU=y
>>>>        CONFIG_LTO_NONE=y
>>>>        CONFIG_ARCH_VECNOTIRQ=y
>>>>        CONFIG_ARCH_HAVE_TEXT_HEAP=y
>>>>        CONFIG_ARCH_HAVE_MULTICPU=y
>>>>        CONFIG_ARCH_HAVE_FPU=y
>>>>        CONFIG_ARCH_HAVE_MPU=y
>>>>        CONFIG_ARCH_HAVE_RESET=y
>>>>        CONFIG_ARCH_HAVE_TESTSET=y
>>>>        CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
>>>>        CONFIG_ARCH_HAVE_BACKTRACE=y
>>>>        CONFIG_ARCH_HAVE_BOOTLOADER=y
>>>>        CONFIG_ARCH_HAVE_CPUINFO=y
>>>>        CONFIG_ARCH_FPU=y
>>>>        CONFIG_ARCH_STACKDUMP=y
>>>>        CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
>>>>        CONFIG_BOARD_LOOPSPERMSEC=16717
>>>>        CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
>>>>        CONFIG_ARCH_INTERRUPTSTACK=0
>>>>        CONFIG_BOOT_RUNFROMFLASH=y
>>>>        CONFIG_RAM_START=0x20000000
>>>>        CONFIG_RAM_SIZE=114688
>>>>        CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
>>>>        CONFIG_ARCH_HAVE_LEDS=y
>>>>        CONFIG_ARCH_HAVE_BUTTONS=y
>>>>        CONFIG_ARCH_BOARD_COMMON=y
>>>>        CONFIG_BOARDCTL=y
>>>>        CONFIG_BOARDCTL_MKRD=y
>>>>        CONFIG_DISABLE_OS_API=y
>>>>        CONFIG_USEC_PER_TICK=10000
>>>>        CONFIG_START_YEAR=2011
>>>>        CONFIG_START_MONTH=12
>>>>        CONFIG_START_DAY=6
>>>>        CONFIG_PREALLOC_TIMERS=4
>>>>        CONFIG_INIT_ENTRY=y
>>>>        CONFIG_INIT_ARGS=""
>>>>        CONFIG_INIT_STACKSIZE=2048
>>>>        CONFIG_INIT_PRIORITY=100
>>>>        CONFIG_INIT_ENTRYPOINT="nsh_main"
>>>>        CONFIG_INIT_ENTRYNAME="nsh_main"
>>>>        CONFIG_RR_INTERVAL=200
>>>>        CONFIG_TASK_NAME_SIZE=31
>>>>        CONFIG_SCHED_WAITPID=y
>>>>        CONFIG_PTHREAD_MUTEX_ROBUST=y
>>>>        CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
>>>>        CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
>>>>        CONFIG_DEV_CONSOLE=y
>>>>        CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
>>>>        CONFIG_FILE_STREAM=y
>>>>        CONFIG_NAME_MAX=32
>>>>        CONFIG_PATH_MAX=256
>>>>        CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
>>>>        CONFIG_PREALLOC_MQ_MSGS=8
>>>>        CONFIG_PREALLOC_MQ_IRQ_MSGS=8
>>>>        CONFIG_MQ_MAXMSGSIZE=32
>>>>        CONFIG_DEFAULT_TASK_STACKSIZE=2048
>>>>        CONFIG_IDLETHREAD_STACKSIZE=3072
>>>>        CONFIG_PTHREAD_STACK_MIN=256
>>>>        CONFIG_PTHREAD_STACK_DEFAULT=2048
>>>>        CONFIG_ARCH_HAVE_I2CRESET=y
>>>>        CONFIG_DEV_NULL=y
>>>>        CONFIG_DRVR_MKRD=y
>>>>        CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
>>>>        CONFIG_SERIAL=y
>>>>        CONFIG_SERIAL_CONSOLE=y
>>>>        CONFIG_MCU_SERIAL=y
>>>>        CONFIG_STANDARD_SERIAL=y
>>>>        CONFIG_SERIAL_NPOLLWAITERS=4
>>>>        CONFIG_UART0_SERIAL_CONSOLE=y
>>>>        CONFIG_UART0_SERIALDRIVER=y
>>>>        CONFIG_UART0_RXBUFSIZE=256
>>>>        CONFIG_UART0_TXBUFSIZE=256
>>>>        CONFIG_UART0_BAUD=115200
>>>>        CONFIG_UART0_BITS=8
>>>>        CONFIG_UART0_PARITY=0
>>>>        CONFIG_UART0_2STOP=0
>>>>        CONFIG_SYSLOG_MAX_CHANNELS=1
>>>>        CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
>>>>        CONFIG_SYSLOG_DEFAULT=y
>>>>        CONFIG_FS_NEPOLL_DESCRIPTORS=8
>>>>        CONFIG_SENDFILE_BUFSIZE=512
>>>>        CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
>>>>        CONFIG_FS_MQUEUE_NPOLLWAITERS=4
>>>>        CONFIG_FS_ANONMAP=y
>>>>        CONFIG_FS_PROCFS=y
>>>>        CONFIG_FS_PROCFS_MAX_TASKS=128
>>>>        CONFIG_NXFONTS_PACKEDMSFIRST=y
>>>>        CONFIG_MM_DEFAULT_MANAGER=y
>>>>        CONFIG_MM_DFAULT_ALIGNMENT=0
>>>>        CONFIG_MM_REGIONS=3
>>>>        CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
>>>>        CONFIG_MM_BACKTRACE=-1
>>>>        CONFIG_STDIO_BUFFER_SIZE=64
>>>>        CONFIG_STDIO_LINEBUFFER=y
>>>>        CONFIG_NUNGET_CHARS=2
>>>>        CONFIG_LIBC_FLOATINGPOINT=y
>>>>        CONFIG_LIBC_LONG_LONG=y
>>>>        CONFIG_ARCH_LOWPUTC=y
>>>>        CONFIG_LIBC_ARCH_ATOMIC=y
>>>>        CONFIG_LIBC_ARCH_MEMCHR=y
>>>>        CONFIG_LIBC_ARCH_MEMCPY=y
>>>>        CONFIG_LIBC_ARCH_MEMCMP=y
>>>>        CONFIG_LIBC_ARCH_MEMMOVE=y
>>>>        CONFIG_LIBC_ARCH_MEMSET=y
>>>>        CONFIG_LIBC_ARCH_STRCHR=y
>>>>        CONFIG_LIBC_ARCH_STRCMP=y
>>>>        CONFIG_LIBC_ARCH_STRCPY=y
>>>>        CONFIG_LIBC_ARCH_STRLCPY=y
>>>>        CONFIG_LIBC_ARCH_STRNCPY=y
>>>>        CONFIG_LIBC_ARCH_STRLEN=y
>>>>        CONFIG_LIBC_ARCH_STRNLEN=y
>>>>        CONFIG_LIBC_PREVENT_STRING_KERNEL=y
>>>>        CONFIG_LIBC_RAND_ORDER=1
>>>>        CONFIG_LIBC_HOMEDIR="/"
>>>>        CONFIG_LIBC_TMPDIR="/tmp"
>>>>        CONFIG_LIBC_MAX_TMPFILE=32
>>>>        CONFIG_LIBC_MAX_EXITFUNS=0
>>>>        CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
>>>>        CONFIG_LIBC_HOSTNAME=""
>>>>        CONFIG_LIBC_OPEN_MAX=256
>>>>        CONFIG_LIBC_STRERROR_ERRNUM=y
>>>>        CONFIG_LIBC_STRSIGNAL=y
>>>>        CONFIG_TLS_NELEM=4
>>>>        CONFIG_TLS_TASK_NELEM=0
>>>>        CONFIG_LIBC_GAISTRERROR_ERRNUM=y
>>>>        CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
>>>>        CONFIG_LIBC_MEMFD_ERROR=y
>>>>        CONFIG_BUILTIN=y
>>>>        CONFIG_STREAM_OUT_BUFFER_SIZE=64
>>>>        CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
>>>>        CONFIG_LIBM_TOOLCHAIN=y
>>>>        CONFIG_HAVE_CXX=y
>>>>        CONFIG_HAVE_CXXINITIALIZE=y
>>>>        CONFIG_LIBCXXMINI=y
>>>>        CONFIG_CXX_STANDARD="gnu++17"
>>>>        CONFIG_NSH_LIBRARY=y
>>>>        CONFIG_NSH_PROMPT_STRING="nsh> "
>>>>        CONFIG_NSH_READLINE=y
>>>>        CONFIG_NSH_LINELEN=64
>>>>        CONFIG_NSH_MAXARGUMENTS=7
>>>>        CONFIG_NSH_NESTDEPTH=3
>>>>        CONFIG_NSH_ALIAS=y
>>>>        CONFIG_NSH_ALIAS_MAX_AMOUNT=1
>>>>        CONFIG_NSH_BUILTIN_APPS=y
>>>>        CONFIG_NSH_DISABLE_DATE=y
>>>>        CONFIG_NSH_DISABLE_LOSMART=y
>>>>        CONFIG_NSH_DISABLE_LOMTD=y
>>>>        CONFIG_NSH_DISABLE_MB=y
>>>>        CONFIG_NSH_DISABLE_MH=y
>>>>        CONFIG_NSH_DISABLE_MW=y
>>>>        CONFIG_NSH_DISABLE_TIMEDATECTL=y
>>>>        CONFIG_NSH_CODECS_BUFSIZE=128
>>>>        CONFIG_NSH_PROC_MOUNTPOINT="/proc"
>>>>        CONFIG_NSH_FILEIOSIZE=512
>>>>        CONFIG_NSH_CONSOLE=y
>>>>        CONFIG_NSH_ARCHINIT=y
>>>>        CONFIG_SYSTEM_NSH=y
>>>>        CONFIG_SYSTEM_NSH_PRIORITY=100
>>>>        CONFIG_SYSTEM_NSH_STACKSIZE=2048
>>>>        CONFIG_SYSTEM_NSH_PROGNAME="nsh"
>>>>        CONFIG_SYSTEM_NXDIAG=y
>>>>        CONFIG_SYSTEM_NXDIAG_PRIORITY=100
>>>>        CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
>>>>        CONFIG_SYSTEM_NXDIAG_CONF=y
>>>>        CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
>>>>        CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
>>>>        CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
>>>>        CONFIG_SYSTEM_READLINE=y
>>>>        CONFIG_READLINE_HAVE_EXTMATCH=y
>>>>        CONFIG_READLINE_ECHO=y
>>>>
>>>> Host system OS:
>>>>        Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic #26~22.04.1-Ubuntu
>>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
>>>>
>>>> Host system PATH:
>>>>        /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
>>>>        /home/mmoretti/bin
>>>>        /home/mmoretti/tools/bin
>>>>        /home/mmoretti/bin
>>>>        /home/mmoretti/tools/bin
>>>>        /home/mmoretti/.local/bin
>>>>        /usr/local/sbin
>>>>        /usr/local/bin
>>>>        /usr/sbin
>>>>        /usr/bin
>>>>        /sbin
>>>>        /bin
>>>>        /usr/games
>>>>        /usr/local/games
>>>>        /snap/bin
>>>>
>>>> Espressif specific information:
>>>>
>>>> Bootloader version:
>>>>        esp32: v5.1-dev-3972-g1559b6309f
>>>>        esp32s2: Bootloader image not found
>>>>        esp32s3: Bootloader image not found
>>>>        esp32c2: Bootloader image not found
>>>>        esp32c3: Bootloader image not found
>>>>        esp32c6: Bootloader image not found
>>>>        esp32h2: Bootloader image not found
>>>>
>>>> Toolchain version:
>>>>        clang: Not found
>>>>        gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
>>>>        xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
>>>> esp-12.2.0_20230208) 12.2.0
>>>>        xtensa-esp32s2-elf-gcc: Not found
>>>>        xtensa-esp32s3-elf-gcc: Not found
>>>>        riscv32-esp-elf-gcc: Not found
>>>>        riscv64-unknown-elf-gcc: Not found
>>>>
>>>> Esptool version: 4.6.2
>>>>
>>>> nsh>
>>>>
>>>>
>>>> -m
>>>>
>>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
>>>>> Hi Mike,
>>>>>
>>>>> We have been using NuttX on ESP32 for a while. The
>>>>> `esp32-devkitc:blewifi`
>>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS` and
>>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running it.
>>>>>
>>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run the
>>>>> `nxdiag -all` from the NSH (please refer to
>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag).
>>>>> Please share your results for reevaluation ;)
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>
>>>>>> It appears that when using the blewifi configuration out of the box,
>>>>>> and
>>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION, and
>>>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as I've
>>>>>> gotten so far.  I'm still tweaking other configs to see if they cause
>>>>>> hanging as well.
>>>>>>
>>>>>> This just does NOT appear to be a stable OS on the ESP32.
>>>>>>
>>>>>> -m
>>>>>>
>>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>>>>>> Hi!
>>>>>>>
>>>>>>> Good to know that! Yes, there are packages that need to be selected
>>>>>>> to
>>>>>> make
>>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>>>>>
>>>>>>> Please note that BLE's log is enabled with the other wireless logs
>>>>>> through
>>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this helps
>>>>>>> debugging.
>>>>>>>
>>>>>>> Best regards,
>>>>>>>
>>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps
>>>>>>>> and
>>>>>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>>>>>> configuration to work.  In my old tree, make distclean apparently
>>>>>>>> didn't
>>>>>>>> clean something, or my old tree was corrupt somehow.
>>>>>>>>
>>>>>>>> However, I still cannot get my own config to work (the one I
>>>>>>>> previously
>>>>>>>> attached).  There's a lot more stuff I need enabled than what is
>>>>>>>> enabled
>>>>>>>> by default in the blewifi configuration.  I guess I will just have
>>>>>>>> to
>>>>>>>> randomly keep modifying different config params until something
>>>>>>>> works.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> -m
>>>>>>>>
>>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>>>>>> Hi Mike,
>>>>>>>>>
>>>>>>>>> I found no trouble using the esp32-devkitc:blewifi configuration.
>>>>>>>>> May
>>>>>>>>> I
>>>>>>>> ask
>>>>>>>>> you to double-check your bootloader/partition-table configuration?
>>>>>>>>> (you
>>>>>>>> can
>>>>>>>>> refer to
>>>>>>>>>
>>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>>>>>> ).
>>>>>>>>>
>>>>>>>>> If not successful yet, please do the following:
>>>>>>>>>
>>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag
>>>>>>>>> -all`
>>>>>>>>> from the NSH (please refer to
>>>>>>>>>
>>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>>>>>> ).
>>>>>>>>> Please share your results for reevaluattion ;)
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>>
>>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI tests
>>>>>>>>>> all
>>>>>>>> the
>>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>>>>>
>>>>>>>>>> I'll check.
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>>
>>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>>>>>
>>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I get
>>>>>>>> problems
>>>>>>>>>>> with it telling me there's no bootable app.
>>>>>>>>>>>
>>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and
>>>>>>>>>>> add
>>>>>>>> wifi
>>>>>>>>>>> and ble to it via menuconfig, I get only a little further.  It
>>>>>>>>>>> gets
>>>>>>>> past
>>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.
>>>>>>>>>>> With
>>>>>>>> all the
>>>>>>>>>>> ble options disabled and only wifi configured by itself it
>>>>>>>>>>> actually
>>>>>>>> boots
>>>>>>>>>>> into nsh after some time.  (At first, I had a somewhat similar
>>>>>>>>>>> issue
>>>>>>>> with
>>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't defined
>>>>>>>>>>> in
>>>>>> the
>>>>>>>>>>> config file, where it would seem to hang and then finally show a
>>>>>>>> prompt.
>>>>>>>>>>> It wasn't until I actually figured out about turning on
>>>>>>>>>>> CONFIG_DEBUG
>>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of errors
>>>>>> during
>>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to just
>>>>>>>>>>> wait
>>>>>>>> for it
>>>>>>>>>>> a bit to show an nsh prompt.)
>>>>>>>>>>>
>>>>>>>>>>> However, there don't seem to be any config debug options for
>>>>>> bluetooth.
>>>>>>>>>>> I have no idea why it hangs as no messages are displayed and it
>>>>>>>>>>> never
>>>>>>>> shows
>>>>>>>>>>> a prompt even after a half an hour.  I've now spent hours messing
>>>>>> with
>>>>>>>>>>> various BLE configuration options with no luck.  I'm including my
>>>>>>>> config
>>>>>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> -m
>>>>>>>>>>> --
>>>>>>>>>>> Mike Moretti
>>>>>>>>>>> ♩♫♫♩♪♩
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Tiago Medicci Serrano
>>>>>>>>>>
>>>>>>>>>> Embedded Software Engineer
>>>>>>>>>> MSc Electronics/Microelectronics
>>>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>>>>>> e:tiago.medicci@gmail.com
>>>>>>>>>> a: Campinas, Brazil
>>>>>>>>>> Follow me:
>>>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>>>>>> <https://github.com/tmedicci>
>>>>>>>>>>
>>


Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Mike Moretti <nu...@mordent.com.INVALID>.
<irony>Wait, so you're telling me I should submit a PR, but you spent 
the time to document this on your own web site instead of submitting a 
PR to the official NuttX docs yourself?</irony> ;-)

-m

On 9/1/2023 10:02 AM, Alan C. Assis wrote:
> Probably because we didn't update the documentation yet! :-)
>
> <irony> We're developers, we don't care about documentation...
> documentation is for wimps! </irony>
>
> Of course we need to improve our documentation! This is why all new PR
> introducing some new feature I insist to people include documentation.
>
> Please consider submitting a patch fixing it.
>
> BR,
>
> Alan
>
> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>> Wait, so, the NuttX docs say to just download the bootloader/partitions
>> from some link.  If we have to make the bootloader ourselves why isn't
>> that part of the NuttX official documentation?
>>
>> -m
>>
>> On 9/1/2023 9:13 AM, Alan C. Assis wrote:
>>> Hi Mike,
>>>
>>> Please sure you are using the right bootloader too:
>>>
>>> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
>>>
>>> BR,
>>>
>>> Alan
>>>
>>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>>> Hi,
>>>>
>>>> So, just to be sure, I made a completely fresh directory, untarred the
>>>> 12.2.1 tarballs into it, did ./tools/configure.sh esp32-devkitc:blewifi,
>>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then
>>>> flashed.  It boots to nsh but then doesn't accept any input; it's hung.
>>>> If I have my wifi credentials in the config, so many messages come out I
>>>> can't tell if it displayed the nsh prompt, but the last thing I see
>>>> before it hangs and doesn't accept any input is some message about wifi
>>>> (I'm assuming it connected).
>>>>
>>>> I then tried, after yet another rm+untar (yes, I'm removing both nuttx
>>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag, but
>>>> it wouldn't build.
>>>>
>>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04 LTS)
>>>> for other projects, I've just been use the toolchain that comes with it
>>>> instead of the "latest" one recommend via the NuttX docs link.
>>>> Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4 vs
>>>> gcc-12.2).
>>>>
>>>> So I installed the newer toolchain and esptool.py as directed by the
>>>> NuttX documentation.  I then opened a new shell without running the
>>>> ESP-IDF environment setup script, manually set my path to include the
>>>> new toolchain, and tried again.  However, after yet another rm+untar and
>>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I still
>>>> get the same problem with it hanging.
>>>>
>>>> But luckily, with the newer toolchain, I'm at least able to build and
>>>> run nxdiag and here is the output:
>>>>
>>>> nxdiag --all
>>>> Nxdiag Report:
>>>>
>>>> NuttX RTOS info:
>>>>        Hostname:
>>>>        Release: 12.2.1
>>>>        Build: 148c631a2d Sep  1 2023 08:45:59
>>>>        Arch: xtensa
>>>>        Defconfig: esp32-devkitc:nxdiag
>>>>
>>>> NuttX CFLAGS:
>>>>        -fno-common
>>>>        -Wall
>>>>        -Wstrict-prototypes
>>>>        -Wshadow
>>>>        -Wundef
>>>>        -Os
>>>>        -fno-strict-aliasing
>>>>        -fomit-frame-pointer
>>>>        -ffunction-sections
>>>>        -fdata-sections
>>>>        -mlongcalls
>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>        -D__NuttX__
>>>>        -DNDEBUG
>>>>        -pipe
>>>>        -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>
>>>> NuttX CXXFLAGS:
>>>>        -fno-common
>>>>        -nostdinc++
>>>>        -Wall
>>>>        -Wshadow
>>>>        -Wundef
>>>>        -std="gnu++17"
>>>>        -fno-exceptions
>>>>        -fcheck-new
>>>>        -fno-rtti
>>>>        -Os
>>>>        -fno-strict-aliasing
>>>>        -fomit-frame-pointer
>>>>        -ffunction-sections
>>>>        -fdata-sections
>>>>        -mlongcalls
>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
>>>>        -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>>        -D__NuttX__
>>>>        -DNDEBUG
>>>>        -pipe
>>>>        -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>>
>>>> NuttX LDFLAGS:
>>>>        -nostdlib
>>>>        --gc-sections
>>>>        --cref
>>>>        -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
>>>>
>>>> NuttX configuration options:
>>>>        CONFIG_HOST_LINUX=y
>>>>        CONFIG_APPS_DIR="../apps"
>>>>        CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
>>>>        CONFIG_BUILD_FLAT=y
>>>>        CONFIG_INTELHEX_BINARY=y
>>>>        CONFIG_ARCH_HAVE_STDARG_H=y
>>>>        CONFIG_ARCH_HAVE_SETJMP=y
>>>>        CONFIG_ARCH_NONE_DEBUG_H=y
>>>>        CONFIG_FORTIFY_SOURCE=0
>>>>        CONFIG_NDEBUG=y
>>>>        CONFIG_DEBUG_ALERT=y
>>>>        CONFIG_ARCH_HAVE_STACKCHECK=y
>>>>        CONFIG_ARCH_HAVE_CUSTOMOPT=y
>>>>        CONFIG_DEBUG_FULLOPT=y
>>>>        CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
>>>>        CONFIG_DEBUG_LINK_MAP=y
>>>>        CONFIG_ARCH_XTENSA=y
>>>>        CONFIG_ARCH="xtensa"
>>>>        CONFIG_ARCH_CHIP="esp32"
>>>>        CONFIG_ARCH_BOARD="esp32-devkitc"
>>>>        CONFIG_ARCH_CHIP_ESP32=y
>>>>        CONFIG_ARCH_FAMILY_LX6=y
>>>>        CONFIG_XTENSA_CP_INITSET=0x0001
>>>>        CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
>>>>        CONFIG_XTENSA_BTDEPTH=50
>>>>        CONFIG_XTENSA_TOOLCHAIN_ESP=y
>>>>        CONFIG_ARCH_CHIP_ESP32WROVER=y
>>>>        CONFIG_ESP32_DUAL_CPU=y
>>>>        CONFIG_ESP32_FLASH_4M=y
>>>>        CONFIG_ESP32_FLASH_DETECT=y
>>>>        CONFIG_ESP32_PSRAM_8M=y
>>>>        CONFIG_ESP32_ESP32DXWDXX=y
>>>>        CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
>>>>        CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
>>>>        CONFIG_ESP32_XTAL_40MZ=y
>>>>        CONFIG_ESP32_UART=y
>>>>        CONFIG_ESP32_RTC=y
>>>>        CONFIG_ESP32_UART0=y
>>>>        CONFIG_ESP32_BT_RESERVE_DRAM=0
>>>>        CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
>>>>        CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
>>>>        CONFIG_ESP32_UART0_TXPIN=1
>>>>        CONFIG_ESP32_UART0_RXPIN=3
>>>>        CONFIG_ESP32_FLASH_MODE_DIO=y
>>>>        CONFIG_ESP32_FLASH_FREQ_40M=y
>>>>        CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
>>>>        CONFIG_ESP32_APP_FORMAT_LEGACY=y
>>>>        CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
>>>>        CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
>>>>        CONFIG_ARCH_TOOLCHAIN_GNU=y
>>>>        CONFIG_LTO_NONE=y
>>>>        CONFIG_ARCH_VECNOTIRQ=y
>>>>        CONFIG_ARCH_HAVE_TEXT_HEAP=y
>>>>        CONFIG_ARCH_HAVE_MULTICPU=y
>>>>        CONFIG_ARCH_HAVE_FPU=y
>>>>        CONFIG_ARCH_HAVE_MPU=y
>>>>        CONFIG_ARCH_HAVE_RESET=y
>>>>        CONFIG_ARCH_HAVE_TESTSET=y
>>>>        CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
>>>>        CONFIG_ARCH_HAVE_BACKTRACE=y
>>>>        CONFIG_ARCH_HAVE_BOOTLOADER=y
>>>>        CONFIG_ARCH_HAVE_CPUINFO=y
>>>>        CONFIG_ARCH_FPU=y
>>>>        CONFIG_ARCH_STACKDUMP=y
>>>>        CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
>>>>        CONFIG_BOARD_LOOPSPERMSEC=16717
>>>>        CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
>>>>        CONFIG_ARCH_INTERRUPTSTACK=0
>>>>        CONFIG_BOOT_RUNFROMFLASH=y
>>>>        CONFIG_RAM_START=0x20000000
>>>>        CONFIG_RAM_SIZE=114688
>>>>        CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
>>>>        CONFIG_ARCH_HAVE_LEDS=y
>>>>        CONFIG_ARCH_HAVE_BUTTONS=y
>>>>        CONFIG_ARCH_BOARD_COMMON=y
>>>>        CONFIG_BOARDCTL=y
>>>>        CONFIG_BOARDCTL_MKRD=y
>>>>        CONFIG_DISABLE_OS_API=y
>>>>        CONFIG_USEC_PER_TICK=10000
>>>>        CONFIG_START_YEAR=2011
>>>>        CONFIG_START_MONTH=12
>>>>        CONFIG_START_DAY=6
>>>>        CONFIG_PREALLOC_TIMERS=4
>>>>        CONFIG_INIT_ENTRY=y
>>>>        CONFIG_INIT_ARGS=""
>>>>        CONFIG_INIT_STACKSIZE=2048
>>>>        CONFIG_INIT_PRIORITY=100
>>>>        CONFIG_INIT_ENTRYPOINT="nsh_main"
>>>>        CONFIG_INIT_ENTRYNAME="nsh_main"
>>>>        CONFIG_RR_INTERVAL=200
>>>>        CONFIG_TASK_NAME_SIZE=31
>>>>        CONFIG_SCHED_WAITPID=y
>>>>        CONFIG_PTHREAD_MUTEX_ROBUST=y
>>>>        CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
>>>>        CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
>>>>        CONFIG_DEV_CONSOLE=y
>>>>        CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
>>>>        CONFIG_FILE_STREAM=y
>>>>        CONFIG_NAME_MAX=32
>>>>        CONFIG_PATH_MAX=256
>>>>        CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
>>>>        CONFIG_PREALLOC_MQ_MSGS=8
>>>>        CONFIG_PREALLOC_MQ_IRQ_MSGS=8
>>>>        CONFIG_MQ_MAXMSGSIZE=32
>>>>        CONFIG_DEFAULT_TASK_STACKSIZE=2048
>>>>        CONFIG_IDLETHREAD_STACKSIZE=3072
>>>>        CONFIG_PTHREAD_STACK_MIN=256
>>>>        CONFIG_PTHREAD_STACK_DEFAULT=2048
>>>>        CONFIG_ARCH_HAVE_I2CRESET=y
>>>>        CONFIG_DEV_NULL=y
>>>>        CONFIG_DRVR_MKRD=y
>>>>        CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
>>>>        CONFIG_SERIAL=y
>>>>        CONFIG_SERIAL_CONSOLE=y
>>>>        CONFIG_MCU_SERIAL=y
>>>>        CONFIG_STANDARD_SERIAL=y
>>>>        CONFIG_SERIAL_NPOLLWAITERS=4
>>>>        CONFIG_UART0_SERIAL_CONSOLE=y
>>>>        CONFIG_UART0_SERIALDRIVER=y
>>>>        CONFIG_UART0_RXBUFSIZE=256
>>>>        CONFIG_UART0_TXBUFSIZE=256
>>>>        CONFIG_UART0_BAUD=115200
>>>>        CONFIG_UART0_BITS=8
>>>>        CONFIG_UART0_PARITY=0
>>>>        CONFIG_UART0_2STOP=0
>>>>        CONFIG_SYSLOG_MAX_CHANNELS=1
>>>>        CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
>>>>        CONFIG_SYSLOG_DEFAULT=y
>>>>        CONFIG_FS_NEPOLL_DESCRIPTORS=8
>>>>        CONFIG_SENDFILE_BUFSIZE=512
>>>>        CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
>>>>        CONFIG_FS_MQUEUE_NPOLLWAITERS=4
>>>>        CONFIG_FS_ANONMAP=y
>>>>        CONFIG_FS_PROCFS=y
>>>>        CONFIG_FS_PROCFS_MAX_TASKS=128
>>>>        CONFIG_NXFONTS_PACKEDMSFIRST=y
>>>>        CONFIG_MM_DEFAULT_MANAGER=y
>>>>        CONFIG_MM_DFAULT_ALIGNMENT=0
>>>>        CONFIG_MM_REGIONS=3
>>>>        CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
>>>>        CONFIG_MM_BACKTRACE=-1
>>>>        CONFIG_STDIO_BUFFER_SIZE=64
>>>>        CONFIG_STDIO_LINEBUFFER=y
>>>>        CONFIG_NUNGET_CHARS=2
>>>>        CONFIG_LIBC_FLOATINGPOINT=y
>>>>        CONFIG_LIBC_LONG_LONG=y
>>>>        CONFIG_ARCH_LOWPUTC=y
>>>>        CONFIG_LIBC_ARCH_ATOMIC=y
>>>>        CONFIG_LIBC_ARCH_MEMCHR=y
>>>>        CONFIG_LIBC_ARCH_MEMCPY=y
>>>>        CONFIG_LIBC_ARCH_MEMCMP=y
>>>>        CONFIG_LIBC_ARCH_MEMMOVE=y
>>>>        CONFIG_LIBC_ARCH_MEMSET=y
>>>>        CONFIG_LIBC_ARCH_STRCHR=y
>>>>        CONFIG_LIBC_ARCH_STRCMP=y
>>>>        CONFIG_LIBC_ARCH_STRCPY=y
>>>>        CONFIG_LIBC_ARCH_STRLCPY=y
>>>>        CONFIG_LIBC_ARCH_STRNCPY=y
>>>>        CONFIG_LIBC_ARCH_STRLEN=y
>>>>        CONFIG_LIBC_ARCH_STRNLEN=y
>>>>        CONFIG_LIBC_PREVENT_STRING_KERNEL=y
>>>>        CONFIG_LIBC_RAND_ORDER=1
>>>>        CONFIG_LIBC_HOMEDIR="/"
>>>>        CONFIG_LIBC_TMPDIR="/tmp"
>>>>        CONFIG_LIBC_MAX_TMPFILE=32
>>>>        CONFIG_LIBC_MAX_EXITFUNS=0
>>>>        CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
>>>>        CONFIG_LIBC_HOSTNAME=""
>>>>        CONFIG_LIBC_OPEN_MAX=256
>>>>        CONFIG_LIBC_STRERROR_ERRNUM=y
>>>>        CONFIG_LIBC_STRSIGNAL=y
>>>>        CONFIG_TLS_NELEM=4
>>>>        CONFIG_TLS_TASK_NELEM=0
>>>>        CONFIG_LIBC_GAISTRERROR_ERRNUM=y
>>>>        CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
>>>>        CONFIG_LIBC_MEMFD_ERROR=y
>>>>        CONFIG_BUILTIN=y
>>>>        CONFIG_STREAM_OUT_BUFFER_SIZE=64
>>>>        CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
>>>>        CONFIG_LIBM_TOOLCHAIN=y
>>>>        CONFIG_HAVE_CXX=y
>>>>        CONFIG_HAVE_CXXINITIALIZE=y
>>>>        CONFIG_LIBCXXMINI=y
>>>>        CONFIG_CXX_STANDARD="gnu++17"
>>>>        CONFIG_NSH_LIBRARY=y
>>>>        CONFIG_NSH_PROMPT_STRING="nsh> "
>>>>        CONFIG_NSH_READLINE=y
>>>>        CONFIG_NSH_LINELEN=64
>>>>        CONFIG_NSH_MAXARGUMENTS=7
>>>>        CONFIG_NSH_NESTDEPTH=3
>>>>        CONFIG_NSH_ALIAS=y
>>>>        CONFIG_NSH_ALIAS_MAX_AMOUNT=1
>>>>        CONFIG_NSH_BUILTIN_APPS=y
>>>>        CONFIG_NSH_DISABLE_DATE=y
>>>>        CONFIG_NSH_DISABLE_LOSMART=y
>>>>        CONFIG_NSH_DISABLE_LOMTD=y
>>>>        CONFIG_NSH_DISABLE_MB=y
>>>>        CONFIG_NSH_DISABLE_MH=y
>>>>        CONFIG_NSH_DISABLE_MW=y
>>>>        CONFIG_NSH_DISABLE_TIMEDATECTL=y
>>>>        CONFIG_NSH_CODECS_BUFSIZE=128
>>>>        CONFIG_NSH_PROC_MOUNTPOINT="/proc"
>>>>        CONFIG_NSH_FILEIOSIZE=512
>>>>        CONFIG_NSH_CONSOLE=y
>>>>        CONFIG_NSH_ARCHINIT=y
>>>>        CONFIG_SYSTEM_NSH=y
>>>>        CONFIG_SYSTEM_NSH_PRIORITY=100
>>>>        CONFIG_SYSTEM_NSH_STACKSIZE=2048
>>>>        CONFIG_SYSTEM_NSH_PROGNAME="nsh"
>>>>        CONFIG_SYSTEM_NXDIAG=y
>>>>        CONFIG_SYSTEM_NXDIAG_PRIORITY=100
>>>>        CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
>>>>        CONFIG_SYSTEM_NXDIAG_CONF=y
>>>>        CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
>>>>        CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
>>>>        CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
>>>>        CONFIG_SYSTEM_READLINE=y
>>>>        CONFIG_READLINE_HAVE_EXTMATCH=y
>>>>        CONFIG_READLINE_ECHO=y
>>>>
>>>> Host system OS:
>>>>        Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic #26~22.04.1-Ubuntu
>>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
>>>>
>>>> Host system PATH:
>>>>        /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
>>>>        /home/mmoretti/bin
>>>>        /home/mmoretti/tools/bin
>>>>        /home/mmoretti/bin
>>>>        /home/mmoretti/tools/bin
>>>>        /home/mmoretti/.local/bin
>>>>        /usr/local/sbin
>>>>        /usr/local/bin
>>>>        /usr/sbin
>>>>        /usr/bin
>>>>        /sbin
>>>>        /bin
>>>>        /usr/games
>>>>        /usr/local/games
>>>>        /snap/bin
>>>>
>>>> Espressif specific information:
>>>>
>>>> Bootloader version:
>>>>        esp32: v5.1-dev-3972-g1559b6309f
>>>>        esp32s2: Bootloader image not found
>>>>        esp32s3: Bootloader image not found
>>>>        esp32c2: Bootloader image not found
>>>>        esp32c3: Bootloader image not found
>>>>        esp32c6: Bootloader image not found
>>>>        esp32h2: Bootloader image not found
>>>>
>>>> Toolchain version:
>>>>        clang: Not found
>>>>        gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
>>>>        xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
>>>> esp-12.2.0_20230208) 12.2.0
>>>>        xtensa-esp32s2-elf-gcc: Not found
>>>>        xtensa-esp32s3-elf-gcc: Not found
>>>>        riscv32-esp-elf-gcc: Not found
>>>>        riscv64-unknown-elf-gcc: Not found
>>>>
>>>> Esptool version: 4.6.2
>>>>
>>>> nsh>
>>>>
>>>>
>>>> -m
>>>>
>>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
>>>>> Hi Mike,
>>>>>
>>>>> We have been using NuttX on ESP32 for a while. The
>>>>> `esp32-devkitc:blewifi`
>>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS` and
>>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running it.
>>>>>
>>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run the
>>>>> `nxdiag -all` from the NSH (please refer to
>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag).
>>>>> Please share your results for reevaluation ;)
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>
>>>>>> It appears that when using the blewifi configuration out of the box,
>>>>>> and
>>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION, and
>>>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as I've
>>>>>> gotten so far.  I'm still tweaking other configs to see if they cause
>>>>>> hanging as well.
>>>>>>
>>>>>> This just does NOT appear to be a stable OS on the ESP32.
>>>>>>
>>>>>> -m
>>>>>>
>>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>>>>>> Hi!
>>>>>>>
>>>>>>> Good to know that! Yes, there are packages that need to be selected
>>>>>>> to
>>>>>> make
>>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>>>>>
>>>>>>> Please note that BLE's log is enabled with the other wireless logs
>>>>>> through
>>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this helps
>>>>>>> debugging.
>>>>>>>
>>>>>>> Best regards,
>>>>>>>
>>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps
>>>>>>>> and
>>>>>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>>>>>> configuration to work.  In my old tree, make distclean apparently
>>>>>>>> didn't
>>>>>>>> clean something, or my old tree was corrupt somehow.
>>>>>>>>
>>>>>>>> However, I still cannot get my own config to work (the one I
>>>>>>>> previously
>>>>>>>> attached).  There's a lot more stuff I need enabled than what is
>>>>>>>> enabled
>>>>>>>> by default in the blewifi configuration.  I guess I will just have
>>>>>>>> to
>>>>>>>> randomly keep modifying different config params until something
>>>>>>>> works.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> -m
>>>>>>>>
>>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>>>>>> Hi Mike,
>>>>>>>>>
>>>>>>>>> I found no trouble using the esp32-devkitc:blewifi configuration.
>>>>>>>>> May
>>>>>>>>> I
>>>>>>>> ask
>>>>>>>>> you to double-check your bootloader/partition-table configuration?
>>>>>>>>> (you
>>>>>>>> can
>>>>>>>>> refer to
>>>>>>>>>
>>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>>>>>> ).
>>>>>>>>>
>>>>>>>>> If not successful yet, please do the following:
>>>>>>>>>
>>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag
>>>>>>>>> -all`
>>>>>>>>> from the NSH (please refer to
>>>>>>>>>
>>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>>>>>> ).
>>>>>>>>> Please share your results for reevaluattion ;)
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>>
>>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI tests
>>>>>>>>>> all
>>>>>>>> the
>>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>>>>>
>>>>>>>>>> I'll check.
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>>
>>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>>>>>
>>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I get
>>>>>>>> problems
>>>>>>>>>>> with it telling me there's no bootable app.
>>>>>>>>>>>
>>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and
>>>>>>>>>>> add
>>>>>>>> wifi
>>>>>>>>>>> and ble to it via menuconfig, I get only a little further.  It
>>>>>>>>>>> gets
>>>>>>>> past
>>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.
>>>>>>>>>>> With
>>>>>>>> all the
>>>>>>>>>>> ble options disabled and only wifi configured by itself it
>>>>>>>>>>> actually
>>>>>>>> boots
>>>>>>>>>>> into nsh after some time.  (At first, I had a somewhat similar
>>>>>>>>>>> issue
>>>>>>>> with
>>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't defined
>>>>>>>>>>> in
>>>>>> the
>>>>>>>>>>> config file, where it would seem to hang and then finally show a
>>>>>>>> prompt.
>>>>>>>>>>> It wasn't until I actually figured out about turning on
>>>>>>>>>>> CONFIG_DEBUG
>>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of errors
>>>>>> during
>>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to just
>>>>>>>>>>> wait
>>>>>>>> for it
>>>>>>>>>>> a bit to show an nsh prompt.)
>>>>>>>>>>>
>>>>>>>>>>> However, there don't seem to be any config debug options for
>>>>>> bluetooth.
>>>>>>>>>>> I have no idea why it hangs as no messages are displayed and it
>>>>>>>>>>> never
>>>>>>>> shows
>>>>>>>>>>> a prompt even after a half an hour.  I've now spent hours messing
>>>>>> with
>>>>>>>>>>> various BLE configuration options with no luck.  I'm including my
>>>>>>>> config
>>>>>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> -m
>>>>>>>>>>> --
>>>>>>>>>>> Mike Moretti
>>>>>>>>>>> ♩♫♫♩♪♩
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Tiago Medicci Serrano
>>>>>>>>>>
>>>>>>>>>> Embedded Software Engineer
>>>>>>>>>> MSc Electronics/Microelectronics
>>>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>>>>>> e:tiago.medicci@gmail.com
>>>>>>>>>> a: Campinas, Brazil
>>>>>>>>>> Follow me:
>>>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>>>>>> <https://github.com/tmedicci>
>>>>>>>>>>
>>


Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by "Alan C. Assis" <ac...@gmail.com>.
Probably because we didn't update the documentation yet! :-)

<irony> We're developers, we don't care about documentation...
documentation is for wimps! </irony>

Of course we need to improve our documentation! This is why all new PR
introducing some new feature I insist to people include documentation.

Please consider submitting a patch fixing it.

BR,

Alan

On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
> Wait, so, the NuttX docs say to just download the bootloader/partitions
> from some link.  If we have to make the bootloader ourselves why isn't
> that part of the NuttX official documentation?
>
> -m
>
> On 9/1/2023 9:13 AM, Alan C. Assis wrote:
>> Hi Mike,
>>
>> Please sure you are using the right bootloader too:
>>
>> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
>>
>> BR,
>>
>> Alan
>>
>> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>>> Hi,
>>>
>>> So, just to be sure, I made a completely fresh directory, untarred the
>>> 12.2.1 tarballs into it, did ./tools/configure.sh esp32-devkitc:blewifi,
>>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then
>>> flashed.  It boots to nsh but then doesn't accept any input; it's hung.
>>> If I have my wifi credentials in the config, so many messages come out I
>>> can't tell if it displayed the nsh prompt, but the last thing I see
>>> before it hangs and doesn't accept any input is some message about wifi
>>> (I'm assuming it connected).
>>>
>>> I then tried, after yet another rm+untar (yes, I'm removing both nuttx
>>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag, but
>>> it wouldn't build.
>>>
>>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04 LTS)
>>> for other projects, I've just been use the toolchain that comes with it
>>> instead of the "latest" one recommend via the NuttX docs link.
>>> Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4 vs
>>> gcc-12.2).
>>>
>>> So I installed the newer toolchain and esptool.py as directed by the
>>> NuttX documentation.  I then opened a new shell without running the
>>> ESP-IDF environment setup script, manually set my path to include the
>>> new toolchain, and tried again.  However, after yet another rm+untar and
>>> rebuilding blewifi + ASSERT configs with the newer toolchain, I still
>>> get the same problem with it hanging.
>>>
>>> But luckily, with the newer toolchain, I'm at least able to build and
>>> run nxdiag and here is the output:
>>>
>>> nxdiag --all
>>> Nxdiag Report:
>>>
>>> NuttX RTOS info:
>>>       Hostname:
>>>       Release: 12.2.1
>>>       Build: 148c631a2d Sep  1 2023 08:45:59
>>>       Arch: xtensa
>>>       Defconfig: esp32-devkitc:nxdiag
>>>
>>> NuttX CFLAGS:
>>>       -fno-common
>>>       -Wall
>>>       -Wstrict-prototypes
>>>       -Wshadow
>>>       -Wundef
>>>       -Os
>>>       -fno-strict-aliasing
>>>       -fomit-frame-pointer
>>>       -ffunction-sections
>>>       -fdata-sections
>>>       -mlongcalls
>>>       -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>       -D__NuttX__
>>>       -DNDEBUG
>>>       -pipe
>>>       -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>
>>> NuttX CXXFLAGS:
>>>       -fno-common
>>>       -nostdinc++
>>>       -Wall
>>>       -Wshadow
>>>       -Wundef
>>>       -std="gnu++17"
>>>       -fno-exceptions
>>>       -fcheck-new
>>>       -fno-rtti
>>>       -Os
>>>       -fno-strict-aliasing
>>>       -fomit-frame-pointer
>>>       -ffunction-sections
>>>       -fdata-sections
>>>       -mlongcalls
>>>       -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
>>>       -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>>       -D__NuttX__
>>>       -DNDEBUG
>>>       -pipe
>>>       -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>>
>>> NuttX LDFLAGS:
>>>       -nostdlib
>>>       --gc-sections
>>>       --cref
>>>       -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
>>>
>>> NuttX configuration options:
>>>       CONFIG_HOST_LINUX=y
>>>       CONFIG_APPS_DIR="../apps"
>>>       CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
>>>       CONFIG_BUILD_FLAT=y
>>>       CONFIG_INTELHEX_BINARY=y
>>>       CONFIG_ARCH_HAVE_STDARG_H=y
>>>       CONFIG_ARCH_HAVE_SETJMP=y
>>>       CONFIG_ARCH_NONE_DEBUG_H=y
>>>       CONFIG_FORTIFY_SOURCE=0
>>>       CONFIG_NDEBUG=y
>>>       CONFIG_DEBUG_ALERT=y
>>>       CONFIG_ARCH_HAVE_STACKCHECK=y
>>>       CONFIG_ARCH_HAVE_CUSTOMOPT=y
>>>       CONFIG_DEBUG_FULLOPT=y
>>>       CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
>>>       CONFIG_DEBUG_LINK_MAP=y
>>>       CONFIG_ARCH_XTENSA=y
>>>       CONFIG_ARCH="xtensa"
>>>       CONFIG_ARCH_CHIP="esp32"
>>>       CONFIG_ARCH_BOARD="esp32-devkitc"
>>>       CONFIG_ARCH_CHIP_ESP32=y
>>>       CONFIG_ARCH_FAMILY_LX6=y
>>>       CONFIG_XTENSA_CP_INITSET=0x0001
>>>       CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
>>>       CONFIG_XTENSA_BTDEPTH=50
>>>       CONFIG_XTENSA_TOOLCHAIN_ESP=y
>>>       CONFIG_ARCH_CHIP_ESP32WROVER=y
>>>       CONFIG_ESP32_DUAL_CPU=y
>>>       CONFIG_ESP32_FLASH_4M=y
>>>       CONFIG_ESP32_FLASH_DETECT=y
>>>       CONFIG_ESP32_PSRAM_8M=y
>>>       CONFIG_ESP32_ESP32DXWDXX=y
>>>       CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
>>>       CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
>>>       CONFIG_ESP32_XTAL_40MZ=y
>>>       CONFIG_ESP32_UART=y
>>>       CONFIG_ESP32_RTC=y
>>>       CONFIG_ESP32_UART0=y
>>>       CONFIG_ESP32_BT_RESERVE_DRAM=0
>>>       CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
>>>       CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
>>>       CONFIG_ESP32_UART0_TXPIN=1
>>>       CONFIG_ESP32_UART0_RXPIN=3
>>>       CONFIG_ESP32_FLASH_MODE_DIO=y
>>>       CONFIG_ESP32_FLASH_FREQ_40M=y
>>>       CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
>>>       CONFIG_ESP32_APP_FORMAT_LEGACY=y
>>>       CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
>>>       CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
>>>       CONFIG_ARCH_TOOLCHAIN_GNU=y
>>>       CONFIG_LTO_NONE=y
>>>       CONFIG_ARCH_VECNOTIRQ=y
>>>       CONFIG_ARCH_HAVE_TEXT_HEAP=y
>>>       CONFIG_ARCH_HAVE_MULTICPU=y
>>>       CONFIG_ARCH_HAVE_FPU=y
>>>       CONFIG_ARCH_HAVE_MPU=y
>>>       CONFIG_ARCH_HAVE_RESET=y
>>>       CONFIG_ARCH_HAVE_TESTSET=y
>>>       CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
>>>       CONFIG_ARCH_HAVE_BACKTRACE=y
>>>       CONFIG_ARCH_HAVE_BOOTLOADER=y
>>>       CONFIG_ARCH_HAVE_CPUINFO=y
>>>       CONFIG_ARCH_FPU=y
>>>       CONFIG_ARCH_STACKDUMP=y
>>>       CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
>>>       CONFIG_BOARD_LOOPSPERMSEC=16717
>>>       CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
>>>       CONFIG_ARCH_INTERRUPTSTACK=0
>>>       CONFIG_BOOT_RUNFROMFLASH=y
>>>       CONFIG_RAM_START=0x20000000
>>>       CONFIG_RAM_SIZE=114688
>>>       CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
>>>       CONFIG_ARCH_HAVE_LEDS=y
>>>       CONFIG_ARCH_HAVE_BUTTONS=y
>>>       CONFIG_ARCH_BOARD_COMMON=y
>>>       CONFIG_BOARDCTL=y
>>>       CONFIG_BOARDCTL_MKRD=y
>>>       CONFIG_DISABLE_OS_API=y
>>>       CONFIG_USEC_PER_TICK=10000
>>>       CONFIG_START_YEAR=2011
>>>       CONFIG_START_MONTH=12
>>>       CONFIG_START_DAY=6
>>>       CONFIG_PREALLOC_TIMERS=4
>>>       CONFIG_INIT_ENTRY=y
>>>       CONFIG_INIT_ARGS=""
>>>       CONFIG_INIT_STACKSIZE=2048
>>>       CONFIG_INIT_PRIORITY=100
>>>       CONFIG_INIT_ENTRYPOINT="nsh_main"
>>>       CONFIG_INIT_ENTRYNAME="nsh_main"
>>>       CONFIG_RR_INTERVAL=200
>>>       CONFIG_TASK_NAME_SIZE=31
>>>       CONFIG_SCHED_WAITPID=y
>>>       CONFIG_PTHREAD_MUTEX_ROBUST=y
>>>       CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
>>>       CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
>>>       CONFIG_DEV_CONSOLE=y
>>>       CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
>>>       CONFIG_FILE_STREAM=y
>>>       CONFIG_NAME_MAX=32
>>>       CONFIG_PATH_MAX=256
>>>       CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
>>>       CONFIG_PREALLOC_MQ_MSGS=8
>>>       CONFIG_PREALLOC_MQ_IRQ_MSGS=8
>>>       CONFIG_MQ_MAXMSGSIZE=32
>>>       CONFIG_DEFAULT_TASK_STACKSIZE=2048
>>>       CONFIG_IDLETHREAD_STACKSIZE=3072
>>>       CONFIG_PTHREAD_STACK_MIN=256
>>>       CONFIG_PTHREAD_STACK_DEFAULT=2048
>>>       CONFIG_ARCH_HAVE_I2CRESET=y
>>>       CONFIG_DEV_NULL=y
>>>       CONFIG_DRVR_MKRD=y
>>>       CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
>>>       CONFIG_SERIAL=y
>>>       CONFIG_SERIAL_CONSOLE=y
>>>       CONFIG_MCU_SERIAL=y
>>>       CONFIG_STANDARD_SERIAL=y
>>>       CONFIG_SERIAL_NPOLLWAITERS=4
>>>       CONFIG_UART0_SERIAL_CONSOLE=y
>>>       CONFIG_UART0_SERIALDRIVER=y
>>>       CONFIG_UART0_RXBUFSIZE=256
>>>       CONFIG_UART0_TXBUFSIZE=256
>>>       CONFIG_UART0_BAUD=115200
>>>       CONFIG_UART0_BITS=8
>>>       CONFIG_UART0_PARITY=0
>>>       CONFIG_UART0_2STOP=0
>>>       CONFIG_SYSLOG_MAX_CHANNELS=1
>>>       CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
>>>       CONFIG_SYSLOG_DEFAULT=y
>>>       CONFIG_FS_NEPOLL_DESCRIPTORS=8
>>>       CONFIG_SENDFILE_BUFSIZE=512
>>>       CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
>>>       CONFIG_FS_MQUEUE_NPOLLWAITERS=4
>>>       CONFIG_FS_ANONMAP=y
>>>       CONFIG_FS_PROCFS=y
>>>       CONFIG_FS_PROCFS_MAX_TASKS=128
>>>       CONFIG_NXFONTS_PACKEDMSFIRST=y
>>>       CONFIG_MM_DEFAULT_MANAGER=y
>>>       CONFIG_MM_DFAULT_ALIGNMENT=0
>>>       CONFIG_MM_REGIONS=3
>>>       CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
>>>       CONFIG_MM_BACKTRACE=-1
>>>       CONFIG_STDIO_BUFFER_SIZE=64
>>>       CONFIG_STDIO_LINEBUFFER=y
>>>       CONFIG_NUNGET_CHARS=2
>>>       CONFIG_LIBC_FLOATINGPOINT=y
>>>       CONFIG_LIBC_LONG_LONG=y
>>>       CONFIG_ARCH_LOWPUTC=y
>>>       CONFIG_LIBC_ARCH_ATOMIC=y
>>>       CONFIG_LIBC_ARCH_MEMCHR=y
>>>       CONFIG_LIBC_ARCH_MEMCPY=y
>>>       CONFIG_LIBC_ARCH_MEMCMP=y
>>>       CONFIG_LIBC_ARCH_MEMMOVE=y
>>>       CONFIG_LIBC_ARCH_MEMSET=y
>>>       CONFIG_LIBC_ARCH_STRCHR=y
>>>       CONFIG_LIBC_ARCH_STRCMP=y
>>>       CONFIG_LIBC_ARCH_STRCPY=y
>>>       CONFIG_LIBC_ARCH_STRLCPY=y
>>>       CONFIG_LIBC_ARCH_STRNCPY=y
>>>       CONFIG_LIBC_ARCH_STRLEN=y
>>>       CONFIG_LIBC_ARCH_STRNLEN=y
>>>       CONFIG_LIBC_PREVENT_STRING_KERNEL=y
>>>       CONFIG_LIBC_RAND_ORDER=1
>>>       CONFIG_LIBC_HOMEDIR="/"
>>>       CONFIG_LIBC_TMPDIR="/tmp"
>>>       CONFIG_LIBC_MAX_TMPFILE=32
>>>       CONFIG_LIBC_MAX_EXITFUNS=0
>>>       CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
>>>       CONFIG_LIBC_HOSTNAME=""
>>>       CONFIG_LIBC_OPEN_MAX=256
>>>       CONFIG_LIBC_STRERROR_ERRNUM=y
>>>       CONFIG_LIBC_STRSIGNAL=y
>>>       CONFIG_TLS_NELEM=4
>>>       CONFIG_TLS_TASK_NELEM=0
>>>       CONFIG_LIBC_GAISTRERROR_ERRNUM=y
>>>       CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
>>>       CONFIG_LIBC_MEMFD_ERROR=y
>>>       CONFIG_BUILTIN=y
>>>       CONFIG_STREAM_OUT_BUFFER_SIZE=64
>>>       CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
>>>       CONFIG_LIBM_TOOLCHAIN=y
>>>       CONFIG_HAVE_CXX=y
>>>       CONFIG_HAVE_CXXINITIALIZE=y
>>>       CONFIG_LIBCXXMINI=y
>>>       CONFIG_CXX_STANDARD="gnu++17"
>>>       CONFIG_NSH_LIBRARY=y
>>>       CONFIG_NSH_PROMPT_STRING="nsh> "
>>>       CONFIG_NSH_READLINE=y
>>>       CONFIG_NSH_LINELEN=64
>>>       CONFIG_NSH_MAXARGUMENTS=7
>>>       CONFIG_NSH_NESTDEPTH=3
>>>       CONFIG_NSH_ALIAS=y
>>>       CONFIG_NSH_ALIAS_MAX_AMOUNT=1
>>>       CONFIG_NSH_BUILTIN_APPS=y
>>>       CONFIG_NSH_DISABLE_DATE=y
>>>       CONFIG_NSH_DISABLE_LOSMART=y
>>>       CONFIG_NSH_DISABLE_LOMTD=y
>>>       CONFIG_NSH_DISABLE_MB=y
>>>       CONFIG_NSH_DISABLE_MH=y
>>>       CONFIG_NSH_DISABLE_MW=y
>>>       CONFIG_NSH_DISABLE_TIMEDATECTL=y
>>>       CONFIG_NSH_CODECS_BUFSIZE=128
>>>       CONFIG_NSH_PROC_MOUNTPOINT="/proc"
>>>       CONFIG_NSH_FILEIOSIZE=512
>>>       CONFIG_NSH_CONSOLE=y
>>>       CONFIG_NSH_ARCHINIT=y
>>>       CONFIG_SYSTEM_NSH=y
>>>       CONFIG_SYSTEM_NSH_PRIORITY=100
>>>       CONFIG_SYSTEM_NSH_STACKSIZE=2048
>>>       CONFIG_SYSTEM_NSH_PROGNAME="nsh"
>>>       CONFIG_SYSTEM_NXDIAG=y
>>>       CONFIG_SYSTEM_NXDIAG_PRIORITY=100
>>>       CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
>>>       CONFIG_SYSTEM_NXDIAG_CONF=y
>>>       CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
>>>       CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
>>>       CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
>>>       CONFIG_SYSTEM_READLINE=y
>>>       CONFIG_READLINE_HAVE_EXTMATCH=y
>>>       CONFIG_READLINE_ECHO=y
>>>
>>> Host system OS:
>>>       Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic #26~22.04.1-Ubuntu
>>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
>>>
>>> Host system PATH:
>>>       /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
>>>       /home/mmoretti/bin
>>>       /home/mmoretti/tools/bin
>>>       /home/mmoretti/bin
>>>       /home/mmoretti/tools/bin
>>>       /home/mmoretti/.local/bin
>>>       /usr/local/sbin
>>>       /usr/local/bin
>>>       /usr/sbin
>>>       /usr/bin
>>>       /sbin
>>>       /bin
>>>       /usr/games
>>>       /usr/local/games
>>>       /snap/bin
>>>
>>> Espressif specific information:
>>>
>>> Bootloader version:
>>>       esp32: v5.1-dev-3972-g1559b6309f
>>>       esp32s2: Bootloader image not found
>>>       esp32s3: Bootloader image not found
>>>       esp32c2: Bootloader image not found
>>>       esp32c3: Bootloader image not found
>>>       esp32c6: Bootloader image not found
>>>       esp32h2: Bootloader image not found
>>>
>>> Toolchain version:
>>>       clang: Not found
>>>       gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
>>>       xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
>>> esp-12.2.0_20230208) 12.2.0
>>>       xtensa-esp32s2-elf-gcc: Not found
>>>       xtensa-esp32s3-elf-gcc: Not found
>>>       riscv32-esp-elf-gcc: Not found
>>>       riscv64-unknown-elf-gcc: Not found
>>>
>>> Esptool version: 4.6.2
>>>
>>> nsh>
>>>
>>>
>>> -m
>>>
>>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
>>>> Hi Mike,
>>>>
>>>> We have been using NuttX on ESP32 for a while. The
>>>> `esp32-devkitc:blewifi`
>>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS` and
>>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running it.
>>>>
>>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run the
>>>> `nxdiag -all` from the NSH (please refer to
>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag).
>>>> Please share your results for reevaluation ;)
>>>>
>>>> Best regards,
>>>>
>>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>
>>>>> It appears that when using the blewifi configuration out of the box,
>>>>> and
>>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION, and
>>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as I've
>>>>> gotten so far.  I'm still tweaking other configs to see if they cause
>>>>> hanging as well.
>>>>>
>>>>> This just does NOT appear to be a stable OS on the ESP32.
>>>>>
>>>>> -m
>>>>>
>>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>>>>> Hi!
>>>>>>
>>>>>> Good to know that! Yes, there are packages that need to be selected
>>>>>> to
>>>>> make
>>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>>>>
>>>>>> Please note that BLE's log is enabled with the other wireless logs
>>>>> through
>>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this helps
>>>>>> debugging.
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps
>>>>>>> and
>>>>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>>>>> configuration to work.  In my old tree, make distclean apparently
>>>>>>> didn't
>>>>>>> clean something, or my old tree was corrupt somehow.
>>>>>>>
>>>>>>> However, I still cannot get my own config to work (the one I
>>>>>>> previously
>>>>>>> attached).  There's a lot more stuff I need enabled than what is
>>>>>>> enabled
>>>>>>> by default in the blewifi configuration.  I guess I will just have
>>>>>>> to
>>>>>>> randomly keep modifying different config params until something
>>>>>>> works.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> -m
>>>>>>>
>>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>>>>> Hi Mike,
>>>>>>>>
>>>>>>>> I found no trouble using the esp32-devkitc:blewifi configuration.
>>>>>>>> May
>>>>>>>> I
>>>>>>> ask
>>>>>>>> you to double-check your bootloader/partition-table configuration?
>>>>>>>> (you
>>>>>>> can
>>>>>>>> refer to
>>>>>>>>
>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>>>>> ).
>>>>>>>>
>>>>>>>> If not successful yet, please do the following:
>>>>>>>>
>>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag
>>>>>>>> -all`
>>>>>>>> from the NSH (please refer to
>>>>>>>>
>>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>>>>> ).
>>>>>>>> Please share your results for reevaluattion ;)
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>>
>>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI tests
>>>>>>>>> all
>>>>>>> the
>>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>>>>
>>>>>>>>> I'll check.
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>>
>>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>>>>
>>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I get
>>>>>>> problems
>>>>>>>>>> with it telling me there's no bootable app.
>>>>>>>>>>
>>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and
>>>>>>>>>> add
>>>>>>> wifi
>>>>>>>>>> and ble to it via menuconfig, I get only a little further.  It
>>>>>>>>>> gets
>>>>>>> past
>>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.
>>>>>>>>>> With
>>>>>>> all the
>>>>>>>>>> ble options disabled and only wifi configured by itself it
>>>>>>>>>> actually
>>>>>>> boots
>>>>>>>>>> into nsh after some time.  (At first, I had a somewhat similar
>>>>>>>>>> issue
>>>>>>> with
>>>>>>>>>> nsh when wifi only is enabled and connection info wasn't defined
>>>>>>>>>> in
>>>>> the
>>>>>>>>>> config file, where it would seem to hang and then finally show a
>>>>>>> prompt.
>>>>>>>>>> It wasn't until I actually figured out about turning on
>>>>>>>>>> CONFIG_DEBUG
>>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of errors
>>>>> during
>>>>>>>>>> boot and I knew it wasn't just hanging permanently and to just
>>>>>>>>>> wait
>>>>>>> for it
>>>>>>>>>> a bit to show an nsh prompt.)
>>>>>>>>>>
>>>>>>>>>> However, there don't seem to be any config debug options for
>>>>> bluetooth.
>>>>>>>>>> I have no idea why it hangs as no messages are displayed and it
>>>>>>>>>> never
>>>>>>> shows
>>>>>>>>>> a prompt even after a half an hour.  I've now spent hours messing
>>>>> with
>>>>>>>>>> various BLE configuration options with no luck.  I'm including my
>>>>>>> config
>>>>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> -m
>>>>>>>>>> --
>>>>>>>>>> Mike Moretti
>>>>>>>>>> ♩♫♫♩♪♩
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Tiago Medicci Serrano
>>>>>>>>>
>>>>>>>>> Embedded Software Engineer
>>>>>>>>> MSc Electronics/Microelectronics
>>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>>>>> e:tiago.medicci@gmail.com
>>>>>>>>> a: Campinas, Brazil
>>>>>>>>> Follow me:
>>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>>>>> <https://github.com/tmedicci>
>>>>>>>>>
>>>
>
>

Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Mike Moretti <nu...@mordent.com.INVALID>.
Wait, so, the NuttX docs say to just download the bootloader/partitions 
from some link.  If we have to make the bootloader ourselves why isn't 
that part of the NuttX official documentation?

-m

On 9/1/2023 9:13 AM, Alan C. Assis wrote:
> Hi Mike,
>
> Please sure you are using the right bootloader too:
>
> https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/
>
> BR,
>
> Alan
>
> On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
>> Hi,
>>
>> So, just to be sure, I made a completely fresh directory, untarred the
>> 12.2.1 tarballs into it, did ./tools/configure.sh esp32-devkitc:blewifi,
>> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then
>> flashed.  It boots to nsh but then doesn't accept any input; it's hung.
>> If I have my wifi credentials in the config, so many messages come out I
>> can't tell if it displayed the nsh prompt, but the last thing I see
>> before it hangs and doesn't accept any input is some message about wifi
>> (I'm assuming it connected).
>>
>> I then tried, after yet another rm+untar (yes, I'm removing both nuttx
>> and apps and re-untarring them), to configure esp32-devkitc:nxdiag, but
>> it wouldn't build.
>>
>> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04 LTS)
>> for other projects, I've just been use the toolchain that comes with it
>> instead of the "latest" one recommend via the NuttX docs link.
>> Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4 vs
>> gcc-12.2).
>>
>> So I installed the newer toolchain and esptool.py as directed by the
>> NuttX documentation.  I then opened a new shell without running the
>> ESP-IDF environment setup script, manually set my path to include the
>> new toolchain, and tried again.  However, after yet another rm+untar and
>> rebuilding blewifi + ASSERT configs with the newer toolchain, I still
>> get the same problem with it hanging.
>>
>> But luckily, with the newer toolchain, I'm at least able to build and
>> run nxdiag and here is the output:
>>
>> nxdiag --all
>> Nxdiag Report:
>>
>> NuttX RTOS info:
>>       Hostname:
>>       Release: 12.2.1
>>       Build: 148c631a2d Sep  1 2023 08:45:59
>>       Arch: xtensa
>>       Defconfig: esp32-devkitc:nxdiag
>>
>> NuttX CFLAGS:
>>       -fno-common
>>       -Wall
>>       -Wstrict-prototypes
>>       -Wshadow
>>       -Wundef
>>       -Os
>>       -fno-strict-aliasing
>>       -fomit-frame-pointer
>>       -ffunction-sections
>>       -fdata-sections
>>       -mlongcalls
>>       -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>       -D__NuttX__
>>       -DNDEBUG
>>       -pipe
>>       -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>
>> NuttX CXXFLAGS:
>>       -fno-common
>>       -nostdinc++
>>       -Wall
>>       -Wshadow
>>       -Wundef
>>       -std="gnu++17"
>>       -fno-exceptions
>>       -fcheck-new
>>       -fno-rtti
>>       -Os
>>       -fno-strict-aliasing
>>       -fomit-frame-pointer
>>       -ffunction-sections
>>       -fdata-sections
>>       -mlongcalls
>>       -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
>>       -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>>       -D__NuttX__
>>       -DNDEBUG
>>       -pipe
>>       -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>>
>> NuttX LDFLAGS:
>>       -nostdlib
>>       --gc-sections
>>       --cref
>>       -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
>>
>> NuttX configuration options:
>>       CONFIG_HOST_LINUX=y
>>       CONFIG_APPS_DIR="../apps"
>>       CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
>>       CONFIG_BUILD_FLAT=y
>>       CONFIG_INTELHEX_BINARY=y
>>       CONFIG_ARCH_HAVE_STDARG_H=y
>>       CONFIG_ARCH_HAVE_SETJMP=y
>>       CONFIG_ARCH_NONE_DEBUG_H=y
>>       CONFIG_FORTIFY_SOURCE=0
>>       CONFIG_NDEBUG=y
>>       CONFIG_DEBUG_ALERT=y
>>       CONFIG_ARCH_HAVE_STACKCHECK=y
>>       CONFIG_ARCH_HAVE_CUSTOMOPT=y
>>       CONFIG_DEBUG_FULLOPT=y
>>       CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
>>       CONFIG_DEBUG_LINK_MAP=y
>>       CONFIG_ARCH_XTENSA=y
>>       CONFIG_ARCH="xtensa"
>>       CONFIG_ARCH_CHIP="esp32"
>>       CONFIG_ARCH_BOARD="esp32-devkitc"
>>       CONFIG_ARCH_CHIP_ESP32=y
>>       CONFIG_ARCH_FAMILY_LX6=y
>>       CONFIG_XTENSA_CP_INITSET=0x0001
>>       CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
>>       CONFIG_XTENSA_BTDEPTH=50
>>       CONFIG_XTENSA_TOOLCHAIN_ESP=y
>>       CONFIG_ARCH_CHIP_ESP32WROVER=y
>>       CONFIG_ESP32_DUAL_CPU=y
>>       CONFIG_ESP32_FLASH_4M=y
>>       CONFIG_ESP32_FLASH_DETECT=y
>>       CONFIG_ESP32_PSRAM_8M=y
>>       CONFIG_ESP32_ESP32DXWDXX=y
>>       CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
>>       CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
>>       CONFIG_ESP32_XTAL_40MZ=y
>>       CONFIG_ESP32_UART=y
>>       CONFIG_ESP32_RTC=y
>>       CONFIG_ESP32_UART0=y
>>       CONFIG_ESP32_BT_RESERVE_DRAM=0
>>       CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
>>       CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
>>       CONFIG_ESP32_UART0_TXPIN=1
>>       CONFIG_ESP32_UART0_RXPIN=3
>>       CONFIG_ESP32_FLASH_MODE_DIO=y
>>       CONFIG_ESP32_FLASH_FREQ_40M=y
>>       CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
>>       CONFIG_ESP32_APP_FORMAT_LEGACY=y
>>       CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
>>       CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
>>       CONFIG_ARCH_TOOLCHAIN_GNU=y
>>       CONFIG_LTO_NONE=y
>>       CONFIG_ARCH_VECNOTIRQ=y
>>       CONFIG_ARCH_HAVE_TEXT_HEAP=y
>>       CONFIG_ARCH_HAVE_MULTICPU=y
>>       CONFIG_ARCH_HAVE_FPU=y
>>       CONFIG_ARCH_HAVE_MPU=y
>>       CONFIG_ARCH_HAVE_RESET=y
>>       CONFIG_ARCH_HAVE_TESTSET=y
>>       CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
>>       CONFIG_ARCH_HAVE_BACKTRACE=y
>>       CONFIG_ARCH_HAVE_BOOTLOADER=y
>>       CONFIG_ARCH_HAVE_CPUINFO=y
>>       CONFIG_ARCH_FPU=y
>>       CONFIG_ARCH_STACKDUMP=y
>>       CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
>>       CONFIG_BOARD_LOOPSPERMSEC=16717
>>       CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
>>       CONFIG_ARCH_INTERRUPTSTACK=0
>>       CONFIG_BOOT_RUNFROMFLASH=y
>>       CONFIG_RAM_START=0x20000000
>>       CONFIG_RAM_SIZE=114688
>>       CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
>>       CONFIG_ARCH_HAVE_LEDS=y
>>       CONFIG_ARCH_HAVE_BUTTONS=y
>>       CONFIG_ARCH_BOARD_COMMON=y
>>       CONFIG_BOARDCTL=y
>>       CONFIG_BOARDCTL_MKRD=y
>>       CONFIG_DISABLE_OS_API=y
>>       CONFIG_USEC_PER_TICK=10000
>>       CONFIG_START_YEAR=2011
>>       CONFIG_START_MONTH=12
>>       CONFIG_START_DAY=6
>>       CONFIG_PREALLOC_TIMERS=4
>>       CONFIG_INIT_ENTRY=y
>>       CONFIG_INIT_ARGS=""
>>       CONFIG_INIT_STACKSIZE=2048
>>       CONFIG_INIT_PRIORITY=100
>>       CONFIG_INIT_ENTRYPOINT="nsh_main"
>>       CONFIG_INIT_ENTRYNAME="nsh_main"
>>       CONFIG_RR_INTERVAL=200
>>       CONFIG_TASK_NAME_SIZE=31
>>       CONFIG_SCHED_WAITPID=y
>>       CONFIG_PTHREAD_MUTEX_ROBUST=y
>>       CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
>>       CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
>>       CONFIG_DEV_CONSOLE=y
>>       CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
>>       CONFIG_FILE_STREAM=y
>>       CONFIG_NAME_MAX=32
>>       CONFIG_PATH_MAX=256
>>       CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
>>       CONFIG_PREALLOC_MQ_MSGS=8
>>       CONFIG_PREALLOC_MQ_IRQ_MSGS=8
>>       CONFIG_MQ_MAXMSGSIZE=32
>>       CONFIG_DEFAULT_TASK_STACKSIZE=2048
>>       CONFIG_IDLETHREAD_STACKSIZE=3072
>>       CONFIG_PTHREAD_STACK_MIN=256
>>       CONFIG_PTHREAD_STACK_DEFAULT=2048
>>       CONFIG_ARCH_HAVE_I2CRESET=y
>>       CONFIG_DEV_NULL=y
>>       CONFIG_DRVR_MKRD=y
>>       CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
>>       CONFIG_SERIAL=y
>>       CONFIG_SERIAL_CONSOLE=y
>>       CONFIG_MCU_SERIAL=y
>>       CONFIG_STANDARD_SERIAL=y
>>       CONFIG_SERIAL_NPOLLWAITERS=4
>>       CONFIG_UART0_SERIAL_CONSOLE=y
>>       CONFIG_UART0_SERIALDRIVER=y
>>       CONFIG_UART0_RXBUFSIZE=256
>>       CONFIG_UART0_TXBUFSIZE=256
>>       CONFIG_UART0_BAUD=115200
>>       CONFIG_UART0_BITS=8
>>       CONFIG_UART0_PARITY=0
>>       CONFIG_UART0_2STOP=0
>>       CONFIG_SYSLOG_MAX_CHANNELS=1
>>       CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
>>       CONFIG_SYSLOG_DEFAULT=y
>>       CONFIG_FS_NEPOLL_DESCRIPTORS=8
>>       CONFIG_SENDFILE_BUFSIZE=512
>>       CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
>>       CONFIG_FS_MQUEUE_NPOLLWAITERS=4
>>       CONFIG_FS_ANONMAP=y
>>       CONFIG_FS_PROCFS=y
>>       CONFIG_FS_PROCFS_MAX_TASKS=128
>>       CONFIG_NXFONTS_PACKEDMSFIRST=y
>>       CONFIG_MM_DEFAULT_MANAGER=y
>>       CONFIG_MM_DFAULT_ALIGNMENT=0
>>       CONFIG_MM_REGIONS=3
>>       CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
>>       CONFIG_MM_BACKTRACE=-1
>>       CONFIG_STDIO_BUFFER_SIZE=64
>>       CONFIG_STDIO_LINEBUFFER=y
>>       CONFIG_NUNGET_CHARS=2
>>       CONFIG_LIBC_FLOATINGPOINT=y
>>       CONFIG_LIBC_LONG_LONG=y
>>       CONFIG_ARCH_LOWPUTC=y
>>       CONFIG_LIBC_ARCH_ATOMIC=y
>>       CONFIG_LIBC_ARCH_MEMCHR=y
>>       CONFIG_LIBC_ARCH_MEMCPY=y
>>       CONFIG_LIBC_ARCH_MEMCMP=y
>>       CONFIG_LIBC_ARCH_MEMMOVE=y
>>       CONFIG_LIBC_ARCH_MEMSET=y
>>       CONFIG_LIBC_ARCH_STRCHR=y
>>       CONFIG_LIBC_ARCH_STRCMP=y
>>       CONFIG_LIBC_ARCH_STRCPY=y
>>       CONFIG_LIBC_ARCH_STRLCPY=y
>>       CONFIG_LIBC_ARCH_STRNCPY=y
>>       CONFIG_LIBC_ARCH_STRLEN=y
>>       CONFIG_LIBC_ARCH_STRNLEN=y
>>       CONFIG_LIBC_PREVENT_STRING_KERNEL=y
>>       CONFIG_LIBC_RAND_ORDER=1
>>       CONFIG_LIBC_HOMEDIR="/"
>>       CONFIG_LIBC_TMPDIR="/tmp"
>>       CONFIG_LIBC_MAX_TMPFILE=32
>>       CONFIG_LIBC_MAX_EXITFUNS=0
>>       CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
>>       CONFIG_LIBC_HOSTNAME=""
>>       CONFIG_LIBC_OPEN_MAX=256
>>       CONFIG_LIBC_STRERROR_ERRNUM=y
>>       CONFIG_LIBC_STRSIGNAL=y
>>       CONFIG_TLS_NELEM=4
>>       CONFIG_TLS_TASK_NELEM=0
>>       CONFIG_LIBC_GAISTRERROR_ERRNUM=y
>>       CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
>>       CONFIG_LIBC_MEMFD_ERROR=y
>>       CONFIG_BUILTIN=y
>>       CONFIG_STREAM_OUT_BUFFER_SIZE=64
>>       CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
>>       CONFIG_LIBM_TOOLCHAIN=y
>>       CONFIG_HAVE_CXX=y
>>       CONFIG_HAVE_CXXINITIALIZE=y
>>       CONFIG_LIBCXXMINI=y
>>       CONFIG_CXX_STANDARD="gnu++17"
>>       CONFIG_NSH_LIBRARY=y
>>       CONFIG_NSH_PROMPT_STRING="nsh> "
>>       CONFIG_NSH_READLINE=y
>>       CONFIG_NSH_LINELEN=64
>>       CONFIG_NSH_MAXARGUMENTS=7
>>       CONFIG_NSH_NESTDEPTH=3
>>       CONFIG_NSH_ALIAS=y
>>       CONFIG_NSH_ALIAS_MAX_AMOUNT=1
>>       CONFIG_NSH_BUILTIN_APPS=y
>>       CONFIG_NSH_DISABLE_DATE=y
>>       CONFIG_NSH_DISABLE_LOSMART=y
>>       CONFIG_NSH_DISABLE_LOMTD=y
>>       CONFIG_NSH_DISABLE_MB=y
>>       CONFIG_NSH_DISABLE_MH=y
>>       CONFIG_NSH_DISABLE_MW=y
>>       CONFIG_NSH_DISABLE_TIMEDATECTL=y
>>       CONFIG_NSH_CODECS_BUFSIZE=128
>>       CONFIG_NSH_PROC_MOUNTPOINT="/proc"
>>       CONFIG_NSH_FILEIOSIZE=512
>>       CONFIG_NSH_CONSOLE=y
>>       CONFIG_NSH_ARCHINIT=y
>>       CONFIG_SYSTEM_NSH=y
>>       CONFIG_SYSTEM_NSH_PRIORITY=100
>>       CONFIG_SYSTEM_NSH_STACKSIZE=2048
>>       CONFIG_SYSTEM_NSH_PROGNAME="nsh"
>>       CONFIG_SYSTEM_NXDIAG=y
>>       CONFIG_SYSTEM_NXDIAG_PRIORITY=100
>>       CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
>>       CONFIG_SYSTEM_NXDIAG_CONF=y
>>       CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
>>       CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
>>       CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
>>       CONFIG_SYSTEM_READLINE=y
>>       CONFIG_READLINE_HAVE_EXTMATCH=y
>>       CONFIG_READLINE_ECHO=y
>>
>> Host system OS:
>>       Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic #26~22.04.1-Ubuntu
>> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
>>
>> Host system PATH:
>>       /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
>>       /home/mmoretti/bin
>>       /home/mmoretti/tools/bin
>>       /home/mmoretti/bin
>>       /home/mmoretti/tools/bin
>>       /home/mmoretti/.local/bin
>>       /usr/local/sbin
>>       /usr/local/bin
>>       /usr/sbin
>>       /usr/bin
>>       /sbin
>>       /bin
>>       /usr/games
>>       /usr/local/games
>>       /snap/bin
>>
>> Espressif specific information:
>>
>> Bootloader version:
>>       esp32: v5.1-dev-3972-g1559b6309f
>>       esp32s2: Bootloader image not found
>>       esp32s3: Bootloader image not found
>>       esp32c2: Bootloader image not found
>>       esp32c3: Bootloader image not found
>>       esp32c6: Bootloader image not found
>>       esp32h2: Bootloader image not found
>>
>> Toolchain version:
>>       clang: Not found
>>       gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
>>       xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
>> esp-12.2.0_20230208) 12.2.0
>>       xtensa-esp32s2-elf-gcc: Not found
>>       xtensa-esp32s3-elf-gcc: Not found
>>       riscv32-esp-elf-gcc: Not found
>>       riscv64-unknown-elf-gcc: Not found
>>
>> Esptool version: 4.6.2
>>
>> nsh>
>>
>>
>> -m
>>
>> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
>>> Hi Mike,
>>>
>>> We have been using NuttX on ESP32 for a while. The
>>> `esp32-devkitc:blewifi`
>>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS` and
>>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running it.
>>>
>>> Again: please use the `esp32-devkitc:nxdiag` configuration and run the
>>> `nxdiag -all` from the NSH (please refer to
>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag).
>>> Please share your results for reevaluation ;)
>>>
>>> Best regards,
>>>
>>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
>>> <nu...@mordent.com.invalid>  escreveu:
>>>
>>>> It appears that when using the blewifi configuration out of the box, and
>>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION, and
>>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as I've
>>>> gotten so far.  I'm still tweaking other configs to see if they cause
>>>> hanging as well.
>>>>
>>>> This just does NOT appear to be a stable OS on the ESP32.
>>>>
>>>> -m
>>>>
>>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>>>> Hi!
>>>>>
>>>>> Good to know that! Yes, there are packages that need to be selected to
>>>> make
>>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>>>
>>>>> Please note that BLE's log is enabled with the other wireless logs
>>>> through
>>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this helps
>>>>> debugging.
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps and
>>>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>>>> configuration to work.  In my old tree, make distclean apparently
>>>>>> didn't
>>>>>> clean something, or my old tree was corrupt somehow.
>>>>>>
>>>>>> However, I still cannot get my own config to work (the one I
>>>>>> previously
>>>>>> attached).  There's a lot more stuff I need enabled than what is
>>>>>> enabled
>>>>>> by default in the blewifi configuration.  I guess I will just have to
>>>>>> randomly keep modifying different config params until something works.
>>>>>>
>>>>>> Thanks,
>>>>>> -m
>>>>>>
>>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>>>> Hi Mike,
>>>>>>>
>>>>>>> I found no trouble using the esp32-devkitc:blewifi configuration. May
>>>>>>> I
>>>>>> ask
>>>>>>> you to double-check your bootloader/partition-table configuration?
>>>>>>> (you
>>>>>> can
>>>>>>> refer to
>>>>>>>
>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>>>> ).
>>>>>>>
>>>>>>> If not successful yet, please do the following:
>>>>>>>
>>>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag
>>>>>>> -all`
>>>>>>> from the NSH (please refer to
>>>>>>>
>>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>>>> ).
>>>>>>> Please share your results for reevaluattion ;)
>>>>>>>
>>>>>>> Best regards,
>>>>>>>
>>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'll take a look at it soon. Interestingly, our internal CI tests
>>>>>>>> all
>>>>>> the
>>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>>>
>>>>>>>> I'll check.
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>>
>>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>>>
>>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I get
>>>>>> problems
>>>>>>>>> with it telling me there's no bootable app.
>>>>>>>>>
>>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and add
>>>>>> wifi
>>>>>>>>> and ble to it via menuconfig, I get only a little further.  It gets
>>>>>> past
>>>>>>>>> the entropy message and then I see "AB" and it hangs forever.  With
>>>>>> all the
>>>>>>>>> ble options disabled and only wifi configured by itself it actually
>>>>>> boots
>>>>>>>>> into nsh after some time.  (At first, I had a somewhat similar
>>>>>>>>> issue
>>>>>> with
>>>>>>>>> nsh when wifi only is enabled and connection info wasn't defined in
>>>> the
>>>>>>>>> config file, where it would seem to hang and then finally show a
>>>>>> prompt.
>>>>>>>>> It wasn't until I actually figured out about turning on
>>>>>>>>> CONFIG_DEBUG
>>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of errors
>>>> during
>>>>>>>>> boot and I knew it wasn't just hanging permanently and to just wait
>>>>>> for it
>>>>>>>>> a bit to show an nsh prompt.)
>>>>>>>>>
>>>>>>>>> However, there don't seem to be any config debug options for
>>>> bluetooth.
>>>>>>>>> I have no idea why it hangs as no messages are displayed and it
>>>>>>>>> never
>>>>>> shows
>>>>>>>>> a prompt even after a half an hour.  I've now spent hours messing
>>>> with
>>>>>>>>> various BLE configuration options with no luck.  I'm including my
>>>>>> config
>>>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> -m
>>>>>>>>> --
>>>>>>>>> Mike Moretti
>>>>>>>>> ♩♫♫♩♪♩
>>>>>>>>>
>>>>>>>> --
>>>>>>>> Tiago Medicci Serrano
>>>>>>>>
>>>>>>>> Embedded Software Engineer
>>>>>>>> MSc Electronics/Microelectronics
>>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>>>> e:tiago.medicci@gmail.com
>>>>>>>> a: Campinas, Brazil
>>>>>>>> Follow me:
>>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>>>> <https://github.com/tmedicci>
>>>>>>>>
>>


Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Mike,

Please sure you are using the right bootloader too:

https://acassis.wordpress.com/2022/09/27/flashing-nuttx-bootloader-and-firmware-using-make-command/

BR,

Alan

On 9/1/23, Mike Moretti <nu...@mordent.com.invalid> wrote:
> Hi,
>
> So, just to be sure, I made a completely fresh directory, untarred the
> 12.2.1 tarballs into it, did ./tools/configure.sh esp32-devkitc:blewifi,
> changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then
> flashed.  It boots to nsh but then doesn't accept any input; it's hung.
> If I have my wifi credentials in the config, so many messages come out I
> can't tell if it displayed the nsh prompt, but the last thing I see
> before it hangs and doesn't accept any input is some message about wifi
> (I'm assuming it connected).
>
> I then tried, after yet another rm+untar (yes, I'm removing both nuttx
> and apps and re-untarring them), to configure esp32-devkitc:nxdiag, but
> it wouldn't build.
>
> I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04 LTS)
> for other projects, I've just been use the toolchain that comes with it
> instead of the "latest" one recommend via the NuttX docs link.
> Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4 vs
> gcc-12.2).
>
> So I installed the newer toolchain and esptool.py as directed by the
> NuttX documentation.  I then opened a new shell without running the
> ESP-IDF environment setup script, manually set my path to include the
> new toolchain, and tried again.  However, after yet another rm+untar and
> rebuilding blewifi + ASSERT configs with the newer toolchain, I still
> get the same problem with it hanging.
>
> But luckily, with the newer toolchain, I'm at least able to build and
> run nxdiag and here is the output:
>
> nxdiag --all
> Nxdiag Report:
>
> NuttX RTOS info:
>      Hostname:
>      Release: 12.2.1
>      Build: 148c631a2d Sep  1 2023 08:45:59
>      Arch: xtensa
>      Defconfig: esp32-devkitc:nxdiag
>
> NuttX CFLAGS:
>      -fno-common
>      -Wall
>      -Wstrict-prototypes
>      -Wshadow
>      -Wundef
>      -Os
>      -fno-strict-aliasing
>      -fomit-frame-pointer
>      -ffunction-sections
>      -fdata-sections
>      -mlongcalls
>      -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>      -D__NuttX__
>      -DNDEBUG
>      -pipe
>      -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>
> NuttX CXXFLAGS:
>      -fno-common
>      -nostdinc++
>      -Wall
>      -Wshadow
>      -Wundef
>      -std="gnu++17"
>      -fno-exceptions
>      -fcheck-new
>      -fno-rtti
>      -Os
>      -fno-strict-aliasing
>      -fomit-frame-pointer
>      -ffunction-sections
>      -fdata-sections
>      -mlongcalls
>      -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
>      -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
>      -D__NuttX__
>      -DNDEBUG
>      -pipe
>      -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"
>
> NuttX LDFLAGS:
>      -nostdlib
>      --gc-sections
>      --cref
>      -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map
>
> NuttX configuration options:
>      CONFIG_HOST_LINUX=y
>      CONFIG_APPS_DIR="../apps"
>      CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
>      CONFIG_BUILD_FLAT=y
>      CONFIG_INTELHEX_BINARY=y
>      CONFIG_ARCH_HAVE_STDARG_H=y
>      CONFIG_ARCH_HAVE_SETJMP=y
>      CONFIG_ARCH_NONE_DEBUG_H=y
>      CONFIG_FORTIFY_SOURCE=0
>      CONFIG_NDEBUG=y
>      CONFIG_DEBUG_ALERT=y
>      CONFIG_ARCH_HAVE_STACKCHECK=y
>      CONFIG_ARCH_HAVE_CUSTOMOPT=y
>      CONFIG_DEBUG_FULLOPT=y
>      CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
>      CONFIG_DEBUG_LINK_MAP=y
>      CONFIG_ARCH_XTENSA=y
>      CONFIG_ARCH="xtensa"
>      CONFIG_ARCH_CHIP="esp32"
>      CONFIG_ARCH_BOARD="esp32-devkitc"
>      CONFIG_ARCH_CHIP_ESP32=y
>      CONFIG_ARCH_FAMILY_LX6=y
>      CONFIG_XTENSA_CP_INITSET=0x0001
>      CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
>      CONFIG_XTENSA_BTDEPTH=50
>      CONFIG_XTENSA_TOOLCHAIN_ESP=y
>      CONFIG_ARCH_CHIP_ESP32WROVER=y
>      CONFIG_ESP32_DUAL_CPU=y
>      CONFIG_ESP32_FLASH_4M=y
>      CONFIG_ESP32_FLASH_DETECT=y
>      CONFIG_ESP32_PSRAM_8M=y
>      CONFIG_ESP32_ESP32DXWDXX=y
>      CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
>      CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
>      CONFIG_ESP32_XTAL_40MZ=y
>      CONFIG_ESP32_UART=y
>      CONFIG_ESP32_RTC=y
>      CONFIG_ESP32_UART0=y
>      CONFIG_ESP32_BT_RESERVE_DRAM=0
>      CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
>      CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
>      CONFIG_ESP32_UART0_TXPIN=1
>      CONFIG_ESP32_UART0_RXPIN=3
>      CONFIG_ESP32_FLASH_MODE_DIO=y
>      CONFIG_ESP32_FLASH_FREQ_40M=y
>      CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
>      CONFIG_ESP32_APP_FORMAT_LEGACY=y
>      CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
>      CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
>      CONFIG_ARCH_TOOLCHAIN_GNU=y
>      CONFIG_LTO_NONE=y
>      CONFIG_ARCH_VECNOTIRQ=y
>      CONFIG_ARCH_HAVE_TEXT_HEAP=y
>      CONFIG_ARCH_HAVE_MULTICPU=y
>      CONFIG_ARCH_HAVE_FPU=y
>      CONFIG_ARCH_HAVE_MPU=y
>      CONFIG_ARCH_HAVE_RESET=y
>      CONFIG_ARCH_HAVE_TESTSET=y
>      CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
>      CONFIG_ARCH_HAVE_BACKTRACE=y
>      CONFIG_ARCH_HAVE_BOOTLOADER=y
>      CONFIG_ARCH_HAVE_CPUINFO=y
>      CONFIG_ARCH_FPU=y
>      CONFIG_ARCH_STACKDUMP=y
>      CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
>      CONFIG_BOARD_LOOPSPERMSEC=16717
>      CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
>      CONFIG_ARCH_INTERRUPTSTACK=0
>      CONFIG_BOOT_RUNFROMFLASH=y
>      CONFIG_RAM_START=0x20000000
>      CONFIG_RAM_SIZE=114688
>      CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
>      CONFIG_ARCH_HAVE_LEDS=y
>      CONFIG_ARCH_HAVE_BUTTONS=y
>      CONFIG_ARCH_BOARD_COMMON=y
>      CONFIG_BOARDCTL=y
>      CONFIG_BOARDCTL_MKRD=y
>      CONFIG_DISABLE_OS_API=y
>      CONFIG_USEC_PER_TICK=10000
>      CONFIG_START_YEAR=2011
>      CONFIG_START_MONTH=12
>      CONFIG_START_DAY=6
>      CONFIG_PREALLOC_TIMERS=4
>      CONFIG_INIT_ENTRY=y
>      CONFIG_INIT_ARGS=""
>      CONFIG_INIT_STACKSIZE=2048
>      CONFIG_INIT_PRIORITY=100
>      CONFIG_INIT_ENTRYPOINT="nsh_main"
>      CONFIG_INIT_ENTRYNAME="nsh_main"
>      CONFIG_RR_INTERVAL=200
>      CONFIG_TASK_NAME_SIZE=31
>      CONFIG_SCHED_WAITPID=y
>      CONFIG_PTHREAD_MUTEX_ROBUST=y
>      CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
>      CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
>      CONFIG_DEV_CONSOLE=y
>      CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
>      CONFIG_FILE_STREAM=y
>      CONFIG_NAME_MAX=32
>      CONFIG_PATH_MAX=256
>      CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
>      CONFIG_PREALLOC_MQ_MSGS=8
>      CONFIG_PREALLOC_MQ_IRQ_MSGS=8
>      CONFIG_MQ_MAXMSGSIZE=32
>      CONFIG_DEFAULT_TASK_STACKSIZE=2048
>      CONFIG_IDLETHREAD_STACKSIZE=3072
>      CONFIG_PTHREAD_STACK_MIN=256
>      CONFIG_PTHREAD_STACK_DEFAULT=2048
>      CONFIG_ARCH_HAVE_I2CRESET=y
>      CONFIG_DEV_NULL=y
>      CONFIG_DRVR_MKRD=y
>      CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
>      CONFIG_SERIAL=y
>      CONFIG_SERIAL_CONSOLE=y
>      CONFIG_MCU_SERIAL=y
>      CONFIG_STANDARD_SERIAL=y
>      CONFIG_SERIAL_NPOLLWAITERS=4
>      CONFIG_UART0_SERIAL_CONSOLE=y
>      CONFIG_UART0_SERIALDRIVER=y
>      CONFIG_UART0_RXBUFSIZE=256
>      CONFIG_UART0_TXBUFSIZE=256
>      CONFIG_UART0_BAUD=115200
>      CONFIG_UART0_BITS=8
>      CONFIG_UART0_PARITY=0
>      CONFIG_UART0_2STOP=0
>      CONFIG_SYSLOG_MAX_CHANNELS=1
>      CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
>      CONFIG_SYSLOG_DEFAULT=y
>      CONFIG_FS_NEPOLL_DESCRIPTORS=8
>      CONFIG_SENDFILE_BUFSIZE=512
>      CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
>      CONFIG_FS_MQUEUE_NPOLLWAITERS=4
>      CONFIG_FS_ANONMAP=y
>      CONFIG_FS_PROCFS=y
>      CONFIG_FS_PROCFS_MAX_TASKS=128
>      CONFIG_NXFONTS_PACKEDMSFIRST=y
>      CONFIG_MM_DEFAULT_MANAGER=y
>      CONFIG_MM_DFAULT_ALIGNMENT=0
>      CONFIG_MM_REGIONS=3
>      CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
>      CONFIG_MM_BACKTRACE=-1
>      CONFIG_STDIO_BUFFER_SIZE=64
>      CONFIG_STDIO_LINEBUFFER=y
>      CONFIG_NUNGET_CHARS=2
>      CONFIG_LIBC_FLOATINGPOINT=y
>      CONFIG_LIBC_LONG_LONG=y
>      CONFIG_ARCH_LOWPUTC=y
>      CONFIG_LIBC_ARCH_ATOMIC=y
>      CONFIG_LIBC_ARCH_MEMCHR=y
>      CONFIG_LIBC_ARCH_MEMCPY=y
>      CONFIG_LIBC_ARCH_MEMCMP=y
>      CONFIG_LIBC_ARCH_MEMMOVE=y
>      CONFIG_LIBC_ARCH_MEMSET=y
>      CONFIG_LIBC_ARCH_STRCHR=y
>      CONFIG_LIBC_ARCH_STRCMP=y
>      CONFIG_LIBC_ARCH_STRCPY=y
>      CONFIG_LIBC_ARCH_STRLCPY=y
>      CONFIG_LIBC_ARCH_STRNCPY=y
>      CONFIG_LIBC_ARCH_STRLEN=y
>      CONFIG_LIBC_ARCH_STRNLEN=y
>      CONFIG_LIBC_PREVENT_STRING_KERNEL=y
>      CONFIG_LIBC_RAND_ORDER=1
>      CONFIG_LIBC_HOMEDIR="/"
>      CONFIG_LIBC_TMPDIR="/tmp"
>      CONFIG_LIBC_MAX_TMPFILE=32
>      CONFIG_LIBC_MAX_EXITFUNS=0
>      CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
>      CONFIG_LIBC_HOSTNAME=""
>      CONFIG_LIBC_OPEN_MAX=256
>      CONFIG_LIBC_STRERROR_ERRNUM=y
>      CONFIG_LIBC_STRSIGNAL=y
>      CONFIG_TLS_NELEM=4
>      CONFIG_TLS_TASK_NELEM=0
>      CONFIG_LIBC_GAISTRERROR_ERRNUM=y
>      CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
>      CONFIG_LIBC_MEMFD_ERROR=y
>      CONFIG_BUILTIN=y
>      CONFIG_STREAM_OUT_BUFFER_SIZE=64
>      CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
>      CONFIG_LIBM_TOOLCHAIN=y
>      CONFIG_HAVE_CXX=y
>      CONFIG_HAVE_CXXINITIALIZE=y
>      CONFIG_LIBCXXMINI=y
>      CONFIG_CXX_STANDARD="gnu++17"
>      CONFIG_NSH_LIBRARY=y
>      CONFIG_NSH_PROMPT_STRING="nsh> "
>      CONFIG_NSH_READLINE=y
>      CONFIG_NSH_LINELEN=64
>      CONFIG_NSH_MAXARGUMENTS=7
>      CONFIG_NSH_NESTDEPTH=3
>      CONFIG_NSH_ALIAS=y
>      CONFIG_NSH_ALIAS_MAX_AMOUNT=1
>      CONFIG_NSH_BUILTIN_APPS=y
>      CONFIG_NSH_DISABLE_DATE=y
>      CONFIG_NSH_DISABLE_LOSMART=y
>      CONFIG_NSH_DISABLE_LOMTD=y
>      CONFIG_NSH_DISABLE_MB=y
>      CONFIG_NSH_DISABLE_MH=y
>      CONFIG_NSH_DISABLE_MW=y
>      CONFIG_NSH_DISABLE_TIMEDATECTL=y
>      CONFIG_NSH_CODECS_BUFSIZE=128
>      CONFIG_NSH_PROC_MOUNTPOINT="/proc"
>      CONFIG_NSH_FILEIOSIZE=512
>      CONFIG_NSH_CONSOLE=y
>      CONFIG_NSH_ARCHINIT=y
>      CONFIG_SYSTEM_NSH=y
>      CONFIG_SYSTEM_NSH_PRIORITY=100
>      CONFIG_SYSTEM_NSH_STACKSIZE=2048
>      CONFIG_SYSTEM_NSH_PROGNAME="nsh"
>      CONFIG_SYSTEM_NXDIAG=y
>      CONFIG_SYSTEM_NXDIAG_PRIORITY=100
>      CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
>      CONFIG_SYSTEM_NXDIAG_CONF=y
>      CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
>      CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
>      CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
>      CONFIG_SYSTEM_READLINE=y
>      CONFIG_READLINE_HAVE_EXTMATCH=y
>      CONFIG_READLINE_ECHO=y
>
> Host system OS:
>      Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic #26~22.04.1-Ubuntu
> SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64
>
> Host system PATH:
>      /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
>      /home/mmoretti/bin
>      /home/mmoretti/tools/bin
>      /home/mmoretti/bin
>      /home/mmoretti/tools/bin
>      /home/mmoretti/.local/bin
>      /usr/local/sbin
>      /usr/local/bin
>      /usr/sbin
>      /usr/bin
>      /sbin
>      /bin
>      /usr/games
>      /usr/local/games
>      /snap/bin
>
> Espressif specific information:
>
> Bootloader version:
>      esp32: v5.1-dev-3972-g1559b6309f
>      esp32s2: Bootloader image not found
>      esp32s3: Bootloader image not found
>      esp32c2: Bootloader image not found
>      esp32c3: Bootloader image not found
>      esp32c6: Bootloader image not found
>      esp32h2: Bootloader image not found
>
> Toolchain version:
>      clang: Not found
>      gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
>      xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG
> esp-12.2.0_20230208) 12.2.0
>      xtensa-esp32s2-elf-gcc: Not found
>      xtensa-esp32s3-elf-gcc: Not found
>      riscv32-esp-elf-gcc: Not found
>      riscv64-unknown-elf-gcc: Not found
>
> Esptool version: 4.6.2
>
> nsh>
>
>
> -m
>
> On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
>> Hi Mike,
>>
>> We have been using NuttX on ESP32 for a while. The
>> `esp32-devkitc:blewifi`
>> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS` and
>> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running it.
>>
>> Again: please use the `esp32-devkitc:nxdiag` configuration and run the
>> `nxdiag -all` from the NSH (please refer to
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag).
>> Please share your results for reevaluation ;)
>>
>> Best regards,
>>
>> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
>> <nu...@mordent.com.invalid>  escreveu:
>>
>>> It appears that when using the blewifi configuration out of the box, and
>>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION, and
>>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as I've
>>> gotten so far.  I'm still tweaking other configs to see if they cause
>>> hanging as well.
>>>
>>> This just does NOT appear to be a stable OS on the ESP32.
>>>
>>> -m
>>>
>>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>>> Hi!
>>>>
>>>> Good to know that! Yes, there are packages that need to be selected to
>>> make
>>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>>
>>>> Please note that BLE's log is enabled with the other wireless logs
>>> through
>>>> the menuconfig in "*Build Setup → Debug Options*". I hope this helps
>>>> debugging.
>>>>
>>>> Best regards,
>>>>
>>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>
>>>>> Hi,
>>>>>
>>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps and
>>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>>> configuration to work.  In my old tree, make distclean apparently
>>>>> didn't
>>>>> clean something, or my old tree was corrupt somehow.
>>>>>
>>>>> However, I still cannot get my own config to work (the one I
>>>>> previously
>>>>> attached).  There's a lot more stuff I need enabled than what is
>>>>> enabled
>>>>> by default in the blewifi configuration.  I guess I will just have to
>>>>> randomly keep modifying different config params until something works.
>>>>>
>>>>> Thanks,
>>>>> -m
>>>>>
>>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>>> Hi Mike,
>>>>>>
>>>>>> I found no trouble using the esp32-devkitc:blewifi configuration. May
>>>>>> I
>>>>> ask
>>>>>> you to double-check your bootloader/partition-table configuration?
>>>>>> (you
>>>>> can
>>>>>> refer to
>>>>>>
>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>>> ).
>>>>>>
>>>>>> If not successful yet, please do the following:
>>>>>>
>>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag
>>>>>> -all`
>>>>>> from the NSH (please refer to
>>>>>>
>>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>>> ).
>>>>>> Please share your results for reevaluattion ;)
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'll take a look at it soon. Interestingly, our internal CI tests
>>>>>>> all
>>>>> the
>>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>>
>>>>>>> I'll check.
>>>>>>>
>>>>>>> Best regards,
>>>>>>>
>>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>>
>>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I get
>>>>> problems
>>>>>>>> with it telling me there's no bootable app.
>>>>>>>>
>>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and add
>>>>> wifi
>>>>>>>> and ble to it via menuconfig, I get only a little further.  It gets
>>>>> past
>>>>>>>> the entropy message and then I see "AB" and it hangs forever.  With
>>>>> all the
>>>>>>>> ble options disabled and only wifi configured by itself it actually
>>>>> boots
>>>>>>>> into nsh after some time.  (At first, I had a somewhat similar
>>>>>>>> issue
>>>>> with
>>>>>>>> nsh when wifi only is enabled and connection info wasn't defined in
>>> the
>>>>>>>> config file, where it would seem to hang and then finally show a
>>>>> prompt.
>>>>>>>> It wasn't until I actually figured out about turning on
>>>>>>>> CONFIG_DEBUG
>>>>>>>> "ERROR" for network/wireless that it showed me a bunch of errors
>>> during
>>>>>>>> boot and I knew it wasn't just hanging permanently and to just wait
>>>>> for it
>>>>>>>> a bit to show an nsh prompt.)
>>>>>>>>
>>>>>>>> However, there don't seem to be any config debug options for
>>> bluetooth.
>>>>>>>> I have no idea why it hangs as no messages are displayed and it
>>>>>>>> never
>>>>> shows
>>>>>>>> a prompt even after a half an hour.  I've now spent hours messing
>>> with
>>>>>>>> various BLE configuration options with no luck.  I'm including my
>>>>> config
>>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> -m
>>>>>>>> --
>>>>>>>> Mike Moretti
>>>>>>>> ♩♫♫♩♪♩
>>>>>>>>
>>>>>>> --
>>>>>>> Tiago Medicci Serrano
>>>>>>>
>>>>>>> Embedded Software Engineer
>>>>>>> MSc Electronics/Microelectronics
>>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>>> e:tiago.medicci@gmail.com
>>>>>>> a: Campinas, Brazil
>>>>>>> Follow me:
>>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>>> <https://github.com/tmedicci>
>>>>>>>
>
>

Re: Adding bluetooth configuration on esp32 hangs nsh

Posted by Mike Moretti <nu...@mordent.com.INVALID>.
Hi,

So, just to be sure, I made a completely fresh directory, untarred the 
12.2.1 tarballs into it, did ./tools/configure.sh esp32-devkitc:blewifi, 
changed only DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION and then 
flashed.  It boots to nsh but then doesn't accept any input; it's hung.  
If I have my wifi credentials in the config, so many messages come out I 
can't tell if it displayed the nsh prompt, but the last thing I see 
before it hangs and doesn't accept any input is some message about wifi 
(I'm assuming it connected).

I then tried, after yet another rm+untar (yes, I'm removing both nuttx 
and apps and re-untarring them), to configure esp32-devkitc:nxdiag, but 
it wouldn't build.

I then remembered that since I use esp-idf v4.4.5 (on Ubuntu 22.04 LTS) 
for other projects, I've just been use the toolchain that comes with it 
instead of the "latest" one recommend via the NuttX docs link.  
Unfortunately, it's a way older version of the gcc toolchain (gcc-8.4 vs 
gcc-12.2).

So I installed the newer toolchain and esptool.py as directed by the 
NuttX documentation.  I then opened a new shell without running the 
ESP-IDF environment setup script, manually set my path to include the 
new toolchain, and tried again.  However, after yet another rm+untar and 
rebuilding blewifi + ASSERT configs with the newer toolchain, I still 
get the same problem with it hanging.

But luckily, with the newer toolchain, I'm at least able to build and 
run nxdiag and here is the output:

nxdiag --all
Nxdiag Report:

NuttX RTOS info:
     Hostname:
     Release: 12.2.1
     Build: 148c631a2d Sep  1 2023 08:45:59
     Arch: xtensa
     Defconfig: esp32-devkitc:nxdiag

NuttX CFLAGS:
     -fno-common
     -Wall
     -Wstrict-prototypes
     -Wshadow
     -Wundef
     -Os
     -fno-strict-aliasing
     -fomit-frame-pointer
     -ffunction-sections
     -fdata-sections
     -mlongcalls
     -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
     -D__NuttX__
     -DNDEBUG
     -pipe
     -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"

NuttX CXXFLAGS:
     -fno-common
     -nostdinc++
     -Wall
     -Wshadow
     -Wundef
     -std="gnu++17"
     -fno-exceptions
     -fcheck-new
     -fno-rtti
     -Os
     -fno-strict-aliasing
     -fomit-frame-pointer
     -ffunction-sections
     -fdata-sections
     -mlongcalls
     -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include/cxx
     -isystem /home/mmoretti/work/nuttx-12.2.1/nuttx/include
     -D__NuttX__
     -DNDEBUG
     -pipe
     -I "/home/mmoretti/work/nuttx-12.2.1/apps/include"

NuttX LDFLAGS:
     -nostdlib
     --gc-sections
     --cref
     -Map=/home/mmoretti/work/nuttx-12.2.1/nuttx/nuttx.map

NuttX configuration options:
     CONFIG_HOST_LINUX=y
     CONFIG_APPS_DIR="../apps"
     CONFIG_BASE_DEFCONFIG="esp32-devkitc:nxdiag"
     CONFIG_BUILD_FLAT=y
     CONFIG_INTELHEX_BINARY=y
     CONFIG_ARCH_HAVE_STDARG_H=y
     CONFIG_ARCH_HAVE_SETJMP=y
     CONFIG_ARCH_NONE_DEBUG_H=y
     CONFIG_FORTIFY_SOURCE=0
     CONFIG_NDEBUG=y
     CONFIG_DEBUG_ALERT=y
     CONFIG_ARCH_HAVE_STACKCHECK=y
     CONFIG_ARCH_HAVE_CUSTOMOPT=y
     CONFIG_DEBUG_FULLOPT=y
     CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y
     CONFIG_DEBUG_LINK_MAP=y
     CONFIG_ARCH_XTENSA=y
     CONFIG_ARCH="xtensa"
     CONFIG_ARCH_CHIP="esp32"
     CONFIG_ARCH_BOARD="esp32-devkitc"
     CONFIG_ARCH_CHIP_ESP32=y
     CONFIG_ARCH_FAMILY_LX6=y
     CONFIG_XTENSA_CP_INITSET=0x0001
     CONFIG_XTENSA_DUMPBT_ON_ASSERT=y
     CONFIG_XTENSA_BTDEPTH=50
     CONFIG_XTENSA_TOOLCHAIN_ESP=y
     CONFIG_ARCH_CHIP_ESP32WROVER=y
     CONFIG_ESP32_DUAL_CPU=y
     CONFIG_ESP32_FLASH_4M=y
     CONFIG_ESP32_FLASH_DETECT=y
     CONFIG_ESP32_PSRAM_8M=y
     CONFIG_ESP32_ESP32DXWDXX=y
     CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
     CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
     CONFIG_ESP32_XTAL_40MZ=y
     CONFIG_ESP32_UART=y
     CONFIG_ESP32_RTC=y
     CONFIG_ESP32_UART0=y
     CONFIG_ESP32_BT_RESERVE_DRAM=0
     CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0
     CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
     CONFIG_ESP32_UART0_TXPIN=1
     CONFIG_ESP32_UART0_RXPIN=3
     CONFIG_ESP32_FLASH_MODE_DIO=y
     CONFIG_ESP32_FLASH_FREQ_40M=y
     CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
     CONFIG_ESP32_APP_FORMAT_LEGACY=y
     CONFIG_ESP32_BOOTLOADER_DOWNLOAD_PREBUILT=y
     CONFIG_ESP32_PARTITION_TABLE_OFFSET=0x8000
     CONFIG_ARCH_TOOLCHAIN_GNU=y
     CONFIG_LTO_NONE=y
     CONFIG_ARCH_VECNOTIRQ=y
     CONFIG_ARCH_HAVE_TEXT_HEAP=y
     CONFIG_ARCH_HAVE_MULTICPU=y
     CONFIG_ARCH_HAVE_FPU=y
     CONFIG_ARCH_HAVE_MPU=y
     CONFIG_ARCH_HAVE_RESET=y
     CONFIG_ARCH_HAVE_TESTSET=y
     CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
     CONFIG_ARCH_HAVE_BACKTRACE=y
     CONFIG_ARCH_HAVE_BOOTLOADER=y
     CONFIG_ARCH_HAVE_CPUINFO=y
     CONFIG_ARCH_FPU=y
     CONFIG_ARCH_STACKDUMP=y
     CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
     CONFIG_BOARD_LOOPSPERMSEC=16717
     CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
     CONFIG_ARCH_INTERRUPTSTACK=0
     CONFIG_BOOT_RUNFROMFLASH=y
     CONFIG_RAM_START=0x20000000
     CONFIG_RAM_SIZE=114688
     CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
     CONFIG_ARCH_HAVE_LEDS=y
     CONFIG_ARCH_HAVE_BUTTONS=y
     CONFIG_ARCH_BOARD_COMMON=y
     CONFIG_BOARDCTL=y
     CONFIG_BOARDCTL_MKRD=y
     CONFIG_DISABLE_OS_API=y
     CONFIG_USEC_PER_TICK=10000
     CONFIG_START_YEAR=2011
     CONFIG_START_MONTH=12
     CONFIG_START_DAY=6
     CONFIG_PREALLOC_TIMERS=4
     CONFIG_INIT_ENTRY=y
     CONFIG_INIT_ARGS=""
     CONFIG_INIT_STACKSIZE=2048
     CONFIG_INIT_PRIORITY=100
     CONFIG_INIT_ENTRYPOINT="nsh_main"
     CONFIG_INIT_ENTRYNAME="nsh_main"
     CONFIG_RR_INTERVAL=200
     CONFIG_TASK_NAME_SIZE=31
     CONFIG_SCHED_WAITPID=y
     CONFIG_PTHREAD_MUTEX_ROBUST=y
     CONFIG_PTHREAD_MUTEX_DEFAULT_PRIO_NONE=y
     CONFIG_PTHREAD_CLEANUP_STACKSIZE=0
     CONFIG_DEV_CONSOLE=y
     CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
     CONFIG_FILE_STREAM=y
     CONFIG_NAME_MAX=32
     CONFIG_PATH_MAX=256
     CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
     CONFIG_PREALLOC_MQ_MSGS=8
     CONFIG_PREALLOC_MQ_IRQ_MSGS=8
     CONFIG_MQ_MAXMSGSIZE=32
     CONFIG_DEFAULT_TASK_STACKSIZE=2048
     CONFIG_IDLETHREAD_STACKSIZE=3072
     CONFIG_PTHREAD_STACK_MIN=256
     CONFIG_PTHREAD_STACK_DEFAULT=2048
     CONFIG_ARCH_HAVE_I2CRESET=y
     CONFIG_DEV_NULL=y
     CONFIG_DRVR_MKRD=y
     CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
     CONFIG_SERIAL=y
     CONFIG_SERIAL_CONSOLE=y
     CONFIG_MCU_SERIAL=y
     CONFIG_STANDARD_SERIAL=y
     CONFIG_SERIAL_NPOLLWAITERS=4
     CONFIG_UART0_SERIAL_CONSOLE=y
     CONFIG_UART0_SERIALDRIVER=y
     CONFIG_UART0_RXBUFSIZE=256
     CONFIG_UART0_TXBUFSIZE=256
     CONFIG_UART0_BAUD=115200
     CONFIG_UART0_BITS=8
     CONFIG_UART0_PARITY=0
     CONFIG_UART0_2STOP=0
     CONFIG_SYSLOG_MAX_CHANNELS=1
     CONFIG_SYSLOG_DEVPATH="/dev/ttyS1"
     CONFIG_SYSLOG_DEFAULT=y
     CONFIG_FS_NEPOLL_DESCRIPTORS=8
     CONFIG_SENDFILE_BUFSIZE=512
     CONFIG_FS_MQUEUE_VFS_PATH="/var/mqueue"
     CONFIG_FS_MQUEUE_NPOLLWAITERS=4
     CONFIG_FS_ANONMAP=y
     CONFIG_FS_PROCFS=y
     CONFIG_FS_PROCFS_MAX_TASKS=128
     CONFIG_NXFONTS_PACKEDMSFIRST=y
     CONFIG_MM_DEFAULT_MANAGER=y
     CONFIG_MM_DFAULT_ALIGNMENT=0
     CONFIG_MM_REGIONS=3
     CONFIG_MM_HEAP_MEMPOOL_THRESHOLD=0
     CONFIG_MM_BACKTRACE=-1
     CONFIG_STDIO_BUFFER_SIZE=64
     CONFIG_STDIO_LINEBUFFER=y
     CONFIG_NUNGET_CHARS=2
     CONFIG_LIBC_FLOATINGPOINT=y
     CONFIG_LIBC_LONG_LONG=y
     CONFIG_ARCH_LOWPUTC=y
     CONFIG_LIBC_ARCH_ATOMIC=y
     CONFIG_LIBC_ARCH_MEMCHR=y
     CONFIG_LIBC_ARCH_MEMCPY=y
     CONFIG_LIBC_ARCH_MEMCMP=y
     CONFIG_LIBC_ARCH_MEMMOVE=y
     CONFIG_LIBC_ARCH_MEMSET=y
     CONFIG_LIBC_ARCH_STRCHR=y
     CONFIG_LIBC_ARCH_STRCMP=y
     CONFIG_LIBC_ARCH_STRCPY=y
     CONFIG_LIBC_ARCH_STRLCPY=y
     CONFIG_LIBC_ARCH_STRNCPY=y
     CONFIG_LIBC_ARCH_STRLEN=y
     CONFIG_LIBC_ARCH_STRNLEN=y
     CONFIG_LIBC_PREVENT_STRING_KERNEL=y
     CONFIG_LIBC_RAND_ORDER=1
     CONFIG_LIBC_HOMEDIR="/"
     CONFIG_LIBC_TMPDIR="/tmp"
     CONFIG_LIBC_MAX_TMPFILE=32
     CONFIG_LIBC_MAX_EXITFUNS=0
     CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
     CONFIG_LIBC_HOSTNAME=""
     CONFIG_LIBC_OPEN_MAX=256
     CONFIG_LIBC_STRERROR_ERRNUM=y
     CONFIG_LIBC_STRSIGNAL=y
     CONFIG_TLS_NELEM=4
     CONFIG_TLS_TASK_NELEM=0
     CONFIG_LIBC_GAISTRERROR_ERRNUM=y
     CONFIG_LIBC_FTOK_VFS_PATH="/var/ftok"
     CONFIG_LIBC_MEMFD_ERROR=y
     CONFIG_BUILTIN=y
     CONFIG_STREAM_OUT_BUFFER_SIZE=64
     CONFIG_STREAM_HEXDUMP_BUFFER_SIZE=128
     CONFIG_LIBM_TOOLCHAIN=y
     CONFIG_HAVE_CXX=y
     CONFIG_HAVE_CXXINITIALIZE=y
     CONFIG_LIBCXXMINI=y
     CONFIG_CXX_STANDARD="gnu++17"
     CONFIG_NSH_LIBRARY=y
     CONFIG_NSH_PROMPT_STRING="nsh> "
     CONFIG_NSH_READLINE=y
     CONFIG_NSH_LINELEN=64
     CONFIG_NSH_MAXARGUMENTS=7
     CONFIG_NSH_NESTDEPTH=3
     CONFIG_NSH_ALIAS=y
     CONFIG_NSH_ALIAS_MAX_AMOUNT=1
     CONFIG_NSH_BUILTIN_APPS=y
     CONFIG_NSH_DISABLE_DATE=y
     CONFIG_NSH_DISABLE_LOSMART=y
     CONFIG_NSH_DISABLE_LOMTD=y
     CONFIG_NSH_DISABLE_MB=y
     CONFIG_NSH_DISABLE_MH=y
     CONFIG_NSH_DISABLE_MW=y
     CONFIG_NSH_DISABLE_TIMEDATECTL=y
     CONFIG_NSH_CODECS_BUFSIZE=128
     CONFIG_NSH_PROC_MOUNTPOINT="/proc"
     CONFIG_NSH_FILEIOSIZE=512
     CONFIG_NSH_CONSOLE=y
     CONFIG_NSH_ARCHINIT=y
     CONFIG_SYSTEM_NSH=y
     CONFIG_SYSTEM_NSH_PRIORITY=100
     CONFIG_SYSTEM_NSH_STACKSIZE=2048
     CONFIG_SYSTEM_NSH_PROGNAME="nsh"
     CONFIG_SYSTEM_NXDIAG=y
     CONFIG_SYSTEM_NXDIAG_PRIORITY=100
     CONFIG_SYSTEM_NXDIAG_STACKSIZE=2048
     CONFIG_SYSTEM_NXDIAG_CONF=y
     CONFIG_SYSTEM_NXDIAG_COMP_FLAGS=y
     CONFIG_SYSTEM_NXDIAG_HOST_PATH=y
     CONFIG_SYSTEM_NXDIAG_ESPRESSIF=y
     CONFIG_SYSTEM_READLINE=y
     CONFIG_READLINE_HAVE_EXTMATCH=y
     CONFIG_READLINE_ECHO=y

Host system OS:
     Ubuntu 22.04.3 LTS Linux gigue 6.2.0-26-generic #26~22.04.1-Ubuntu 
SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64

Host system PATH:
     /home/mmoretti/tools/xtensa-esp32-elf-12.2.0_20230208/bin
     /home/mmoretti/bin
     /home/mmoretti/tools/bin
     /home/mmoretti/bin
     /home/mmoretti/tools/bin
     /home/mmoretti/.local/bin
     /usr/local/sbin
     /usr/local/bin
     /usr/sbin
     /usr/bin
     /sbin
     /bin
     /usr/games
     /usr/local/games
     /snap/bin

Espressif specific information:

Bootloader version:
     esp32: v5.1-dev-3972-g1559b6309f
     esp32s2: Bootloader image not found
     esp32s3: Bootloader image not found
     esp32c2: Bootloader image not found
     esp32c3: Bootloader image not found
     esp32c6: Bootloader image not found
     esp32h2: Bootloader image not found

Toolchain version:
     clang: Not found
     gcc: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
     xtensa-esp32-elf-gcc: xtensa-esp32-elf-gcc (crosstool-NG 
esp-12.2.0_20230208) 12.2.0
     xtensa-esp32s2-elf-gcc: Not found
     xtensa-esp32s3-elf-gcc: Not found
     riscv32-esp-elf-gcc: Not found
     riscv64-unknown-elf-gcc: Not found

Esptool version: 4.6.2

nsh>


-m

On 9/1/2023 8:13 AM, Tiago Medicci Serrano wrote:
> Hi Mike,
>
> We have been using NuttX on ESP32 for a while. The `esp32-devkitc:blewifi`
> is run by our internal pipeline (which sets the `DEBUG_ASSERTIONS` and
> `DEBUG_ASSERTIONS_EXPRESSION`, btw) and we had no problems running it.
>
> Again: please use the `esp32-devkitc:nxdiag` configuration and run the
> `nxdiag -all` from the NSH (please refer to
> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag).
> Please share your results for reevaluation ;)
>
> Best regards,
>
> Em qui., 31 de ago. de 2023 às 14:00, Mike Moretti
> <nu...@mordent.com.invalid>  escreveu:
>
>> It appears that when using the blewifi configuration out of the box, and
>> just turning on DEBUG_ASSERTIONS and DEBUG_ASSERTIONS_EXPRESSION, and
>> setting wifi ssid/pw causes the esp32 to hang.  This is as far as I've
>> gotten so far.  I'm still tweaking other configs to see if they cause
>> hanging as well.
>>
>> This just does NOT appear to be a stable OS on the ESP32.
>>
>> -m
>>
>> On 8/31/2023 9:05 AM, Tiago Medicci Serrano wrote:
>>> Hi!
>>>
>>> Good to know that! Yes, there are packages that need to be selected to
>> make
>>> it work. The `esp32-devkitc:blewifi` is a good starting point.
>>>
>>> Please note that BLE's log is enabled with the other wireless logs
>> through
>>> the menuconfig in "*Build Setup → Debug Options*". I hope this helps
>>> debugging.
>>>
>>> Best regards,
>>>
>>> Em qua., 30 de ago. de 2023 às 18:29, Mike Moretti
>>> <nu...@mordent.com.invalid>  escreveu:
>>>
>>>> Hi,
>>>>
>>>> Thanks.  It wasn't until I untarred a whole new copy of nuttx+apps and
>>>> ran tools/configure.sh with blewifi that I was able to get that
>>>> configuration to work.  In my old tree, make distclean apparently didn't
>>>> clean something, or my old tree was corrupt somehow.
>>>>
>>>> However, I still cannot get my own config to work (the one I previously
>>>> attached).  There's a lot more stuff I need enabled than what is enabled
>>>> by default in the blewifi configuration.  I guess I will just have to
>>>> randomly keep modifying different config params until something works.
>>>>
>>>> Thanks,
>>>> -m
>>>>
>>>> On 8/30/2023 3:32 PM, Tiago Medicci Serrano wrote:
>>>>> Hi Mike,
>>>>>
>>>>> I found no trouble using the esp32-devkitc:blewifi configuration. May I
>>>> ask
>>>>> you to double-check your bootloader/partition-table configuration? (you
>>>> can
>>>>> refer to
>>>>>
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/index.html#bootloader-and-partitions
>>>>> ).
>>>>>
>>>>> If not successful yet, please do the following:
>>>>>
>>>>> Select the esp32-devkitc:nxdiag configuration and run the `nxdiag -all`
>>>>> from the NSH (please refer to
>>>>>
>> https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32/boards/esp32-devkitc/index.html#nxdiag
>>>> ).
>>>>> Please share your results for reevaluattion ;)
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Em ter., 29 de ago. de 2023 às 18:03, Tiago Medicci Serrano <
>>>>> tiago.medicci@gmail.com> escreveu:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I'll take a look at it soon. Interestingly, our internal CI tests all
>>>> the
>>>>>> defconfigs, so I wouldn't expect any erroneous behavior.
>>>>>>
>>>>>> I'll check.
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Em ter., 29 de ago. de 2023 às 16:38, Mike Moretti
>>>>>> <nu...@mordent.com.invalid>  escreveu:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm using NuttX 12.2.1 on an esp32 wroom devkit.
>>>>>>>
>>>>>>> If I try to configure NuttX via tools/configure.sh using the
>>>>>>> esp32-devkitc:blewifi configuration, when I boot the esp32, I get
>>>> problems
>>>>>>> with it telling me there's no bootable app.
>>>>>>>
>>>>>>> If I instead start with the esp32-devkitc:nsh configuration and add
>>>> wifi
>>>>>>> and ble to it via menuconfig, I get only a little further.  It gets
>>>> past
>>>>>>> the entropy message and then I see "AB" and it hangs forever.  With
>>>> all the
>>>>>>> ble options disabled and only wifi configured by itself it actually
>>>> boots
>>>>>>> into nsh after some time.  (At first, I had a somewhat similar issue
>>>> with
>>>>>>> nsh when wifi only is enabled and connection info wasn't defined in
>> the
>>>>>>> config file, where it would seem to hang and then finally show a
>>>> prompt.
>>>>>>> It wasn't until I actually figured out about turning on CONFIG_DEBUG
>>>>>>> "ERROR" for network/wireless that it showed me a bunch of errors
>> during
>>>>>>> boot and I knew it wasn't just hanging permanently and to just wait
>>>> for it
>>>>>>> a bit to show an nsh prompt.)
>>>>>>>
>>>>>>> However, there don't seem to be any config debug options for
>> bluetooth.
>>>>>>> I have no idea why it hangs as no messages are displayed and it never
>>>> shows
>>>>>>> a prompt even after a half an hour.  I've now spent hours messing
>> with
>>>>>>> various BLE configuration options with no luck.  I'm including my
>>>> config
>>>>>>> file in hope that someone might see something wrong with it.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> -m
>>>>>>> --
>>>>>>> Mike Moretti
>>>>>>> ♩♫♫♩♪♩
>>>>>>>
>>>>>> --
>>>>>> Tiago Medicci Serrano
>>>>>>
>>>>>> Embedded Software Engineer
>>>>>> MSc Electronics/Microelectronics
>>>>>> m: +55 (19) 981403886 <+55+(19)+981403886>
>>>>>> e:tiago.medicci@gmail.com
>>>>>> a: Campinas, Brazil
>>>>>> Follow me:
>>>>>> <https://www.linkedin.com/in/tiago-serrano-924458b6>
>>>>>> <https://github.com/tmedicci>
>>>>>>