Re: how to enable RPMSG...

2023-07-21 Thread Xiang Xiao
On Sat, Jul 22, 2023 at 1:56 AM Ed Sutter  wrote:

> Hi,
> I'm in the process of building up Nuttx on the M7 core of an iMX8MP SOC.
> I started by creating a new chip and board directory duplicating the imxrt
> stuff but renaming them appropriately.  From there I've been slowly
> creeping up in functionality with each of my needed device interfaces, and
> I'm now at a point where I want to implement the RPMSG stuff in Nuttx to
> talk to the Linux running on the A53s.  I've got my own hack of RPMSG
> running using in a Nuttx task using the NXP-SDK code.  This just allows me
> to send and receive messages between the M7 and the A53.  That works fine;
> however, I wanna redo this using whatever is the best path to take in Nuttx
> for this.
>
>
You need implement rptun to enable OpenAMP, here are some implementation:
https://github.com/apache/nuttx/blob/master/arch/arm/src/nrf53/nrf53_rptun.c
https://github.com/apache/nuttx/blob/master/arch/risc-v/src/mpfs/mpfs_ihc.c
https://github.com/apache/nuttx/blob/master/arch/sim/src/sim/sim_rptun.c


> In my case the "remote" processor I want to use RPMSG to communicate with
> is in the same silicon, so there is no external interface (serial or
> network), its a shared memory interface.  I tried building up the
> RPMSGSOCKET example but have not had any luck thus far, and then I noticed
> RPMSG_UART.   Is it reasonable to just make this look like a serial
> connection on the Nuttx side, but under the covers use NXP's shared memory
> hook to connect to the A53?
>

 Yes, you can use either or both between M7 and A53, please watch the
introduction video here: https://www.youtube.com/watch?v=6uehz3WQ0vU
Since you want to communicate with Linux kernel, you have to write Linux
rpmsg driver.


> Thanks
> Ed
>
>


how to enable RPMSG...

2023-07-21 Thread Ed Sutter

Hi,
I'm in the process of building up Nuttx on the M7 core of an iMX8MP SOC.  I 
started by creating a new chip and board directory duplicating the imxrt stuff 
but renaming them appropriately.  From there I've been slowly creeping up in 
functionality with each of my needed device interfaces, and I'm now at a point 
where I want to implement the RPMSG stuff in Nuttx to talk to the Linux running 
on the A53s.  I've got my own hack of RPMSG running using in a Nuttx task using 
the NXP-SDK code.  This just allows me to send and receive messages between the 
M7 and the A53.  That works fine; however, I wanna redo this using whatever is 
the best path to take in Nuttx for this.

In my case the "remote" processor I want to use RPMSG to communicate with is in 
the same silicon, so there is no external interface (serial or network), its a shared 
memory interface.  I tried building up the RPMSGSOCKET example but have not had any luck 
thus far, and then I noticed RPMSG_UART.   Is it reasonable to just make this look like a 
serial connection on the Nuttx side, but under the covers use NXP's shared memory hook to 
connect to the A53?

Thanks
Ed



Re: Unable to get nsh working on Adafruit Feather rp2040

2023-07-21 Thread Alan C. Assis
Hi Richard,

Probably it is a MacOS issue.

I just confirmed it still working fine on Linux (Ubuntu 23.04).

These are the step-by-step process:

---

$ git clone -b 1.1.2 https://github.com/raspberrypi/pico-sdk.git

$ sudo mkdir /opt/pico

$ sudo mv pico-sdk /opt/pico/

$ make distclean

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

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

$ make -j

$ ls -l nuttx.uf2
-rw-rw-r-- 1 alan alan 254464 jul 21 14:41 nuttx.uf2

Press and hold BOOTSEL button, then plug the USB cable

Copy nuttx.uf2 to Rasp Pico Disk volume

Plug a 3.3V USB/Serial adapter this way:

USB/SerialRaspPico
-+
GND  |GND
RXD  |GP0
TXD  |GP1


Configure minicom or other serial console tool to use 115200 @ 8n1
(disable HW Flow Control)

Remove the cable and connect again

Press enter and you will see the NuttShell:

nsh> uname -a
NuttX 12.2.1 4e24230d4a Jul 21 2023 14:41:45 arm raspberrypi-pico

nsh> free
   total   used   freelargest  nused  nfree
Umem: 264364   8796 255568 255568 38  1
nsh>

---

BR,

Alan

On 7/20/23, Richard Fox  wrote:
> Hi,
>
> I'm new to NuttX and to the pico-sdk, (and RTOSs in general). I have an
> Adafruit Feather RP2040 that I was using to experiment with NuttX and I
> haven't been able to get either the nsh or usbnsh apps to work, (and I
> haven't really tried anything else).
>
> I have the Feather RP2040 connected to my Mac using an Adafruit #954 USB
> to TTL serial cable (pre 2014). I have the device wired so that the
> serial cable is connected to GND, Green TX to rp2040:GPIO1, white RX to
> rp2040:GPIO0.
>
> Using this configuration, I have successfully built installed, and
> tested the pico-sdk "pico-examples/build/uart/hello_uart" example that
> prints a string via the serial cable to a terminal emulator on the Mac.
> This was operating at 115200 baud.
>
> I've also successfully built and installed the bi-directional example
> from the Arduino distribution: Arduino:Built-in Examples:4.
> Communications:SerialPassThrough and am able to send to and receive from
> the Feather RP2040 through the serial cable and through the
> cu.usbmodem101 device that gets created when the controller is attached
> to my Mac with a USB cable. Communications were at 9600 baud.
>
> I have the following environment variables set in my build terminal.
>   export PICO_SDK_PATH=/opt/pico/pico-sdk
>   export HOST_PLATFORM=mac
>
> I can start the build process and it seems to succeed:
>
> make distclean
> ./tools/configure.sh -m adafruit-feather-rp2040:nsh
> make -j4
> ...
> LN: platform/board to
> /Users/rfox/Documents/Computers/rtos/apache-nuttx/nuttxspace/apps/platform/dummy
> Register: hello
> Register: nsh
> Register: getprime
> Register: sh
> Register: ostest
> CPP:
> /Users/rfox/Documents/Computers/rtos/apache-nuttx/nuttxspace/nuttx/boards/arm/rp2040/adafruit-feather-rp2040/scripts/adafruit-feather-rp2040-flash.ld->
>
> /Users/rfox/Documents/Computers/rtos/apacheLD: nuttx
>
>
> Generating: nuttx.uf2
> tools/rp2040/elf2uf2 nuttx nuttx.uf2;
> Done.
>
> Then I copy the uf2 binary over to the mounted controller volume using
> the handy BOOTSEL feature.
> After the volume is disconnected and my Mac has harped at me for doing
> it wrong, I open a screen to the device:
>
>   screen /dev/cu.usbserial-110 115200
>
> Hit return a few times and get no response.
>
> I've tried rebooting the controller, disconnecting and reconnecting the
> serial cable, doing both. Nothing seems to make any difference. I've
> tried swapping the RX/TX connections just in case there was a pin
> assignment setting different than the pico-sdk and arduino setups but it
> didn't make any difference.
>
> I've tried also using the usbnsh code but there is never a second device
> created in /dev/ to connect to. That is, /dev/cu.usbserial* device is
> present from the serial cable connection but the "modem" device that
> gets created by using the arduino passthrough, for example,
> /dev/cu.usbmodem101 does not exist when the usbnsh configured RP2040 is
> connected to a USB port.
>
> I figure that I'm missing some step, perhaps something I need to set
> using the optional mkconfig step that I'm skipping over but the solution
> eludes me.
>
> Thanks for any advice,
> Rich.
>
>
>