RE: Raspberry Pi Pico Not Responing

2021-11-21 Thread Yuuichi.A.Nakamura
Oops. I mistook the git option. Please use the following command.

$ git clone -b1.1.2 master https://github.com/raspberrypi/pico-sdk.git


-Original Message-
From: Nakamura, Yuuichi (SGC)  
Sent: Monday, November 22, 2021 3:11 PM
To: dev@nuttx.apache.org; malek.l...@gmail.com
Cc: Nakamura, Yuuichi (SGC) 
Subject: RE: Raspberry Pi Pico Not Responing

Hi Lukas and Alan,

Would you try the following command to get the Raspberry Pi Pico SDK ?

$ git clone -r1.1.2 master https://github.com/raspberrypi/pico-sdk.git

NuttX for Raspberry Pi Pico uses a part of Pico SDK for bootloader, but did not 
follow the latesd SDK update.
By using the fixed version tag instead of the master branch avoids the problem.

Please let me update the document for the present.
I'll follow the latest Pico SDK later.

Best regards,
Yuuichi Nakamura

-Original Message-
From: Alan Carvalho de Assis 
Sent: Monday, November 22, 2021 6:40 AM
To: Lukáš Málek 
Cc: dev 
Subject: Re: Raspberry Pi Pico Not Responing

I forgot to copy the mailing list, it could help other users in the future.

BR,

Alan

On 11/21/21, Alan Carvalho de Assis  wrote:
> Hi Lukas,
>
> I just tested here using the usbnsh:
>
> ./tools/configure.sh raspberrypi-pico:usbnsh
>
> After compiled I copied the nuttx.uf2 to the rasp pico disk and opened 
> the /dev/ttyACM0, then after pressing ENTER three times the NSH> show
> up:
>
> NuttShell (NSH) NuttX-10.2.0-RC0
> nsh> uname -a
> NuttX 10.2.0-RC0 de4bd994f5 Nov 21 2021 18:32:45 arm raspberrypi-pico
> nsh>
>
> Probably you are using the incorrect pins when using the serial to get 
> the default nsh, it is very common to happen, users mess with pins and 
> TXD/RXD all the time.
>
> BR,
>
> Alan
>
> On 11/21/21, Lukáš Málek  wrote:
>> Hi Alan,
>>
>> Thank you for your time and a prompt reply. I followed your steps, 
>> and the make command is working as expected. Unfortunately, after 
>> uploading the uf2 file to the Qt Py RP2040, nothing happens. The 
>> serial port is not responding at all. I have tried two more versions 
>> of the pico-sdk library, the compilation was good. Still, after 
>> compiling, I had the same problem. Do you have any ideas about what 
>> could be wrong? The communication with the serial port should work 
>> the same as with raspberry pi pico, so the problem should be reproducible.
>>
>> Have a nice day!
>>
>> Best regards,
>> Lukas M
>>
>>
>> On 21/11/2021 20:15, Alan Carvalho de Assis wrote:
>>> Did it work for you?
>>>
>>> On 11/20/21, Alan Carvalho de Assis  wrote:
 Hi Lukas,

 I just installed Ubuntu 21.04 and followed the README.txt and 
 duplicated your issue:

 $ sudo apt-get install automake bison build-essential flex 
 gcc-arm-none-eabi gperf git libncurses5-dev libtool libusb-dev 
 libusb-1.0.0-dev pkg-config git

 $ git clone -b master
 https://urldefense.com/v3/__https://github.com/raspberrypi/pico-sdk
 .git__;!!JmoZiZGBv3RvKRSx!oT1D7kZfyOPtmSvn3bXmLD--PF694blQfiUHI3xe4
 P_2h9PIHlISdJxYW6sWJkCcRldQBw$ [github[.]com]

 $ sudo mkdir /opt/rasp_pico

 $ sudo mv pico-sdk /opt/rasp_pico/

 $ export PICO_SDK_PATH=/opt/rasp_pico/pico-sdk

 $ git clone
 https://urldefense.com/v3/__https://github.com/apache/incubator-nut
 tx.git__;!!JmoZiZGBv3RvKRSx!oT1D7kZfyOPtmSvn3bXmLD--PF694blQfiUHI3x
 e4P_2h9PIHlISdJxYW6sWJkAhKvRhEA$ [github[.]com] nuttx

 $ git clone
 https://urldefense.com/v3/__https://github.com/apache/incubator-nut
 tx-apps.git__;!!JmoZiZGBv3RvKRSx!oT1D7kZfyOPtmSvn3bXmLD--PF694blQfi
 UHI3xe4P_2h9PIHlISdJxYW6sWJkDnlA2lWQ$ [github[.]com] apps

 $ make distclean
 NuttX has not been configured!
 To configure the project:
tools/configure.sh 
 For a list of available configurations:
tools/configure.sh -L

 $ ./tools/configure.sh raspberrypi-pico:nsh

 $ make
 ...

 arm-none-eabi-gcc -nostartfiles -nodefaultlibs 
 -T/tmp/nuttx/boards/arm/rp2040/raspberrypi-pico/scripts/raspberrypi
 -pico-flash.ld -DPICO_BOARD=\"pico\" -DPICO_BUILD=1
 -DPICO_NO_HARDWARE=0
 -DPICO_ON_DEVICE=1 -Ichip/boot2
 -I/opt/rasp_pico/pico-sdk/src/rp2_common/boot_stage2/asminclude
 -I/opt/rasp_pico/pico-sdk/src/rp2040/hardware_regs/include
 -I/opt/rasp_pico/pico-sdk/src/rp2_common/hardware_base/include
 -I/opt/rasp_pico/pico-sdk/src/common/pico_base/include
 -I/opt/rasp_pico/pico-sdk/src/boards/include
 -I/opt/rasp_pico/pico-sdk/src/rp2_common/pico_platform/include -o 
 rp2040_boot_stage2.elf 
 /opt/rasp_pico/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S
 In file included from
 /opt/rasp_pico/pico-sdk/src/rp2_common/pico_platform/include/pico/asm_helper.S:7,
   from
 /opt/rasp_pico/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:29:
 /opt/rasp_pico/pico-sdk/src/common/pico_base/include/pico.h:20:10:
 fatal error: pico/version.h: No such 

RE: Raspberry Pi Pico Not Responing

2021-11-21 Thread Yuuichi.A.Nakamura
Hi Lukas and Alan,

Would you try the following command to get the Raspberry Pi Pico SDK ?

$ git clone -r1.1.2 master https://github.com/raspberrypi/pico-sdk.git

NuttX for Raspberry Pi Pico uses a part of Pico SDK for bootloader, but did not 
follow the latesd SDK update.
By using the fixed version tag instead of the master branch avoids the problem.

Please let me update the document for the present.
I'll follow the latest Pico SDK later.

Best regards,
Yuuichi Nakamura

-Original Message-
From: Alan Carvalho de Assis  
Sent: Monday, November 22, 2021 6:40 AM
To: Lukáš Málek 
Cc: dev 
Subject: Re: Raspberry Pi Pico Not Responing

I forgot to copy the mailing list, it could help other users in the future.

BR,

Alan

On 11/21/21, Alan Carvalho de Assis  wrote:
> Hi Lukas,
>
> I just tested here using the usbnsh:
>
> ./tools/configure.sh raspberrypi-pico:usbnsh
>
> After compiled I copied the nuttx.uf2 to the rasp pico disk and opened 
> the /dev/ttyACM0, then after pressing ENTER three times the NSH> show
> up:
>
> NuttShell (NSH) NuttX-10.2.0-RC0
> nsh> uname -a
> NuttX 10.2.0-RC0 de4bd994f5 Nov 21 2021 18:32:45 arm raspberrypi-pico
> nsh>
>
> Probably you are using the incorrect pins when using the serial to get 
> the default nsh, it is very common to happen, users mess with pins and 
> TXD/RXD all the time.
>
> BR,
>
> Alan
>
> On 11/21/21, Lukáš Málek  wrote:
>> Hi Alan,
>>
>> Thank you for your time and a prompt reply. I followed your steps, 
>> and the make command is working as expected. Unfortunately, after 
>> uploading the uf2 file to the Qt Py RP2040, nothing happens. The 
>> serial port is not responding at all. I have tried two more versions 
>> of the pico-sdk library, the compilation was good. Still, after 
>> compiling, I had the same problem. Do you have any ideas about what 
>> could be wrong? The communication with the serial port should work 
>> the same as with raspberry pi pico, so the problem should be reproducible.
>>
>> Have a nice day!
>>
>> Best regards,
>> Lukas M
>>
>>
>> On 21/11/2021 20:15, Alan Carvalho de Assis wrote:
>>> Did it work for you?
>>>
>>> On 11/20/21, Alan Carvalho de Assis  wrote:
 Hi Lukas,

 I just installed Ubuntu 21.04 and followed the README.txt and 
 duplicated your issue:

 $ sudo apt-get install automake bison build-essential flex 
 gcc-arm-none-eabi gperf git libncurses5-dev libtool libusb-dev 
 libusb-1.0.0-dev pkg-config git

 $ git clone -b master 
 https://urldefense.com/v3/__https://github.com/raspberrypi/pico-sdk
 .git__;!!JmoZiZGBv3RvKRSx!oT1D7kZfyOPtmSvn3bXmLD--PF694blQfiUHI3xe4
 P_2h9PIHlISdJxYW6sWJkCcRldQBw$ [github[.]com]

 $ sudo mkdir /opt/rasp_pico

 $ sudo mv pico-sdk /opt/rasp_pico/

 $ export PICO_SDK_PATH=/opt/rasp_pico/pico-sdk

 $ git clone 
 https://urldefense.com/v3/__https://github.com/apache/incubator-nut
 tx.git__;!!JmoZiZGBv3RvKRSx!oT1D7kZfyOPtmSvn3bXmLD--PF694blQfiUHI3x
 e4P_2h9PIHlISdJxYW6sWJkAhKvRhEA$ [github[.]com] nuttx

 $ git clone 
 https://urldefense.com/v3/__https://github.com/apache/incubator-nut
 tx-apps.git__;!!JmoZiZGBv3RvKRSx!oT1D7kZfyOPtmSvn3bXmLD--PF694blQfi
 UHI3xe4P_2h9PIHlISdJxYW6sWJkDnlA2lWQ$ [github[.]com] apps

 $ make distclean
 NuttX has not been configured!
 To configure the project:
tools/configure.sh 
 For a list of available configurations:
tools/configure.sh -L

 $ ./tools/configure.sh raspberrypi-pico:nsh

 $ make
 ...

 arm-none-eabi-gcc -nostartfiles -nodefaultlibs 
 -T/tmp/nuttx/boards/arm/rp2040/raspberrypi-pico/scripts/raspberrypi
 -pico-flash.ld -DPICO_BOARD=\"pico\" -DPICO_BUILD=1 
 -DPICO_NO_HARDWARE=0
 -DPICO_ON_DEVICE=1 -Ichip/boot2
 -I/opt/rasp_pico/pico-sdk/src/rp2_common/boot_stage2/asminclude
 -I/opt/rasp_pico/pico-sdk/src/rp2040/hardware_regs/include
 -I/opt/rasp_pico/pico-sdk/src/rp2_common/hardware_base/include
 -I/opt/rasp_pico/pico-sdk/src/common/pico_base/include
 -I/opt/rasp_pico/pico-sdk/src/boards/include
 -I/opt/rasp_pico/pico-sdk/src/rp2_common/pico_platform/include -o 
 rp2040_boot_stage2.elf 
 /opt/rasp_pico/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S
 In file included from
 /opt/rasp_pico/pico-sdk/src/rp2_common/pico_platform/include/pico/asm_helper.S:7,
   from
 /opt/rasp_pico/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:29:
 /opt/rasp_pico/pico-sdk/src/common/pico_base/include/pico.h:20:10:
 fatal error: pico/version.h: No such file or directory
 20 | #include "pico/version.h"
|  ^~~~
 compilation terminated.
 make[2]: *** [chip/boot2/Make.defs:49: rp2040_boot_stage2.elf] 
 Error 1
 make[2]: Leaving directory '/tmp/nuttx/arch/arm/src'
 make[1]: *** [Makefile:188: .depend] Error 2
 make[1]: Leaving directory 

RE: Nuttx Task Trace

2021-01-07 Thread Yuuichi.A.Nakamura
Dear Sebastian,

> NuttX/nuttx/include/sys/syscall_lookup.h:350:18: error: attempt to use 
> poisoned "getenv"

PX4 project seems to prohibit some APIs by using GCC #pragma in 
src/include/visibility.h
#pragma GCC poison getenv setenv putenv

Because NuttX Task Trace creates wrappers for all APIs to get syscall trace, 
the prohibited APIs by pragma will be used.
If you have no need to use syscall trace, removing 
“CONFIG_SCHED_INSTRUMENTATION_SYSCALL=y” may solve the problem.
Or, the PX4 project build system may should be fixed not to include 
visibility.h when compiling the NuttX kernel code.
Anyway, basically it seems the matter of PX4 project. I’m not familiar with the 
project, sorry.

Thanks,
Yuuichi Nakamura


From: Sebastian Glatz 
Sent: Thursday, January 7, 2021 11:00 PM
To: dev@nuttx.apache.org
Cc: Nakamura, Yuuichi (Sony) 
Subject: Re: Nuttx Task Trace

Dear Yuuichi
I have changed the configuration by invoking: make px4_fmu-v5_default menuconfig
The corresponding configfile is: 
PX4-Autopilot/boards/px4/fmu-v5/nuttx-config/nsh/defconfig
With these changes:
+CONFIG_DRIVER_NOTE=y
+CONFIG_DRIVER_NOTECTL=y
-CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y
+CONFIG_SCHED_INSTRUMENTATION_FILTER=y
+CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER=y
+CONFIG_SCHED_INSTRUMENTATION_SYSCALL=y
-CONFIG_SCHED_WAITPID=y
+CONFIG_SYSTEM_SYSTEM=y
+CONFIG_SYSTEM_TRACE=y
Then when I build the target: make px4_fmu-v5_default
I would get errors in the autogenerated code, such as:
NuttX/nuttx/include/sys/syscall_lookup.h:350:18: error: attempt to use poisoned 
"getenv"
If you have any ideas what I could try, please let me know.

Thank you,
Sebastian

On Tue, Jan 5, 2021 at 8:33 AM 
mailto:yuuichi.a.nakam...@sony.com>> wrote:
Hi Sebastian,

I had mainly tested NuttX Task Trace with spresense:nsh and maix-bit:nsh.
I confirmed the feature by the latest source code by changing the following 
configs and found that it still works.
If possible, would you share the configuration to get the error ?

diff boards/arm/cxd56xx/spresense/configs/nsh/defconfig 
boards/arm/cxd56xx/spresense/configs/nsh-trace/defconfig
28a29,30
> CONFIG_DRIVER_NOTE=y
> CONFIG_DRIVER_NOTECTL=y
45c47,50
< CONFIG_SCHED_WAITPID=y
---
> CONFIG_SCHED_INSTRUMENTATION=y
> CONFIG_SCHED_INSTRUMENTATION_FILTER=y
> CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER=y
> CONFIG_SCHED_INSTRUMENTATION_SYSCALL=y
52a58,59
> CONFIG_SYSTEM_SYSTEM=y
> CONFIG_SYSTEM_TRACE=y

Thanks,
Yuuichi Nakamura

-Original Message-
From: Sebastian Glatz 
mailto:sebastian.gl...@voliro.com>>
Sent: Wednesday, December 30, 2020 9:49 PM
To: dev@nuttx.apache.org
Subject: Nuttx Task Trace

Hi all,

I want to set up *NuttX Task Trace *to profile and debug performance related 
issues of our PX4 modification.

For that I have followed this description:
https://nuttx.apache.org/docs/latest/guides/tasktraceuser.html#nuttx-kernel-configuration
I have edited the .config file. I tried it for both the PX4 project (running on 
Pixhawk 4) and a plain STM32 blink LED app (running on STM32 Blue Pill). 
Neither would build with those kernel configurations in place.

I would get make errors like this:
make[3]: Entering directory '~/nuttx/apps/system/trace'
CC: trace.c
:0:6: error: expected identifier or '(' before numeric constant

Has someone successfully used NuttX Task Trace? How did you proceed?
Also does anyone have some comments on my error message?

Best,
Seb


--
[Voliro AG]
Sebastian Glatz
Robotics Engineer | Voliro AG
phone:  +41 44 632 41 92
mobile:
site:  www.voliro.com
address:  Weinbergstrasse 35, 8092 Zurich - Switzerland
[https://storage.googleapis.com/voliro.com/linkedin.png]
[https://storage.googleapis.com/voliro.com/youtube.png]
[https://storage.googleapis.com/voliro.com/instagram.png]

IMPORTANT: The contents of this email and any attachments are confidential. It 
is strictly forbidden to share any part of this message with any third party, 
without a written consent of the sender. If you received this message by 
mistake, please reply to this message and follow with its deletion, so that we 
can ensure such a mistake does not occur in the future.



RE: Nuttx Task Trace

2021-01-04 Thread Yuuichi.A.Nakamura
Hi Sebastian,

I had mainly tested NuttX Task Trace with spresense:nsh and maix-bit:nsh.
I confirmed the feature by the latest source code by changing the following 
configs and found that it still works.
If possible, would you share the configuration to get the error ?

diff boards/arm/cxd56xx/spresense/configs/nsh/defconfig 
boards/arm/cxd56xx/spresense/configs/nsh-trace/defconfig
28a29,30
> CONFIG_DRIVER_NOTE=y
> CONFIG_DRIVER_NOTECTL=y
45c47,50
< CONFIG_SCHED_WAITPID=y
---
> CONFIG_SCHED_INSTRUMENTATION=y
> CONFIG_SCHED_INSTRUMENTATION_FILTER=y
> CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER=y
> CONFIG_SCHED_INSTRUMENTATION_SYSCALL=y
52a58,59
> CONFIG_SYSTEM_SYSTEM=y
> CONFIG_SYSTEM_TRACE=y

Thanks,
Yuuichi Nakamura

-Original Message-
From: Sebastian Glatz  
Sent: Wednesday, December 30, 2020 9:49 PM
To: dev@nuttx.apache.org
Subject: Nuttx Task Trace

Hi all,

I want to set up *NuttX Task Trace *to profile and debug performance related 
issues of our PX4 modification.

For that I have followed this description:
https://nuttx.apache.org/docs/latest/guides/tasktraceuser.html#nuttx-kernel-configuration
I have edited the .config file. I tried it for both the PX4 project (running on 
Pixhawk 4) and a plain STM32 blink LED app (running on STM32 Blue Pill). 
Neither would build with those kernel configurations in place.

I would get make errors like this:
make[3]: Entering directory '~/nuttx/apps/system/trace'
CC: trace.c
:0:6: error: expected identifier or '(' before numeric constant

Has someone successfully used NuttX Task Trace? How did you proceed?
Also does anyone have some comments on my error message?

Best,
Seb