On Wed, Nov 3, 2021 at 8:14 PM Alan Carvalho de Assis <acas...@gmail.com> wrote:
> Hi Fotis and Tomasz, > > On 11/3/21, Tomasz CEDRO <to...@cedro.info> wrote: > > On Wed, Nov 3, 2021 at 11:37 AM Fotis Panagiotopoulos wrote: > >> I am working on a new NuttX-based firmware. > >> On this application a hardware board will be able to communicate through > >> UART with a Linux system. > >> > >> There is still some testing and development to be done on this Linux > >> program, so I thought that this is a great use for the simulator. > Instead > >> of passing actual hardware boards to every developer, they can start-off > >> with a simulator app for the first steps. > > > > This sounds like a very useful feature! I have no experience yet in > > this area but sounds like local or network socket could be useful here > > to pipe UART from/to the simulator? :-) > > > > I look a look at the simulated UART few week ago and I didn't find a > way to use it with an external USB/Serial adapter. Seams like the > emulated UART is used mostly to fake a UART to NuttX applications, not > to real communication with external UART like we have to I2C and SPI. > > No, The emulated UART is designed to work with the real UART on host. > I think we need some glue just to let NuttX running on simulator get > access to the real UART device of the host. > > You can access the host UART through configuration without any code change. > Xiang, did you (or someone of your team) already use the real host > UART with the simulator? > Yes, we run a sensor/gps program in NuttX, and talk with the external hardware module through host UART. Here is the setup you need to change: 1. set CONFIG_SIM_UART_NUMBER to 1 2. set CONFIG_SIM_UART0_NAME to the host uart path(e.g. /dev/ttyUSB0) If you want to access more host UART at the same time: 1. Increase CONFIG_SIM_UART_NUMBER 2. Set CONFIG_SIM_UART1_NAME, CONFIG_SIM_UART2_NAME... according You can access the host UART inside simulator with the same path(e.g. /dev/ttyUSB0). > BR, > > Alan >