Programando u-blox NINA-B302 com NuttX - Network Support - PING MODEM GSM via PPP
Em redes de computadores, o Point-to-Point Protocol (PPP), em português Protocolo ponto-a-ponto é um protocolo de enlace de dados (camada 2) usado para estabelecer uma conexão direta entre dois nós. Ele pode fornecer autenticação de conexão, criptografia de transmissão (usando ECP, RFC 1968) e compressão.
O PPP é usado sobre muitos tipos de redes físicas incluindo cabo serial, linha telefônica, linha tronco, telefone celular, enlaces de rádio especializados e enlaces de fibra ótica como SONET. O PPP também é usado sobre conexões de acesso à Internet. Provedores de serviços de Internet têm usado o PPP para acesso discado à Internet pelos clientes, uma vez que pacotes IP não podem ser transmitidos sobre uma linha de modem por si próprios, sem algum protocolo de enlace de dados.
$sudo apt install \ bison flex gettext texinfo libncurses5-dev libncursesw5-dev \ gperf automake libtool pkg-config build-essential gperf genromfs \ libgmp-dev libmpc-dev libmpfr-dev libisl-dev binutils-dev libelf-dev \ libexpat-dev gcc-multilib g++-multilib picocom u-boot-tools util-linux
O NuttX utiliza um sistema de build semelhante ao do Kernel do Linux (https://www.kernel.org/doc/html/latest/kbuild/index.html). Ele utiliza o kconfig-frontends como seu sistema de configuração. O repositório tools.git é utilizado para instalar este pacote. Porém se você estiver usando o Ubuntu 19.10 ou mais recente, estas distribuições já contém o pacote, senão instale:$ sudo apt-get install kconfig-frontends
Compilador ARM$sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi
Download do NuttX
$ mkdir nuttx
cd nuttx
git clone https://github.com/apache/incubator-nuttx.git nuttx
git clone https://github.com/apache/incubator-nuttx-apps apps
Seleção do NINA B302 (NRF52840)
$ cd nuttx ./tools/configure.sh -l nrf52840-dk:nsh
osboxes@osboxes:~/nuttx/nuttx$ ./tools/configure.sh -l nrf52840-dk:nsh
No configuration change.
osboxes@osboxes:~/nuttx/nuttx$
Customização e compilação
$ cd nuttx/
$ make clean
$ make menuconfig
.config - NuttX/x86_64 Configuration ──────────────────────────────────────────────────────────────────────────────────── ┌───────────────────────── NuttX/x86_64 Configuration ──────────────────────────┐ │ Arrow keys navigate the menu. <Enter> selects submenus ---> (or empty │ │ submenus ----). Highlighted letters are hotkeys. Pressing <Y> includes, │ │ <N> excludes, <M> modularizes features. Press <Esc><Esc> to exit, <?> for │ │ Help, </> for Search. Legend: [*] built-in [ ] excluded <M> module < > │ │ ┌───────────────────────────────────────────────────────────────────────────┐ │ │ │ Build Setup ---> │ │ │ │ System Type ---> │ │ │ │ Board Selection ---> │ │ │ │ RTOS Features ---> │ │ │ │ Device Drivers ---> │ │ │ │ Networking Support ---> │ │ │ │ Crypto API ---> │ │ │ │ File Systems ---> │ │ │ │ Graphics Support ---> │ │ │ │ Memory Management ---> │ │ │ │ Audio Support ---> │ │ │ │ Video Support ---> │ │ │ │ Wireless Support ---> │ │ │ │ Binary Loader ---> │ │ │ │ Library Routines ---> │ │ │ │ Open Asymmetric Multi Processing ---> │ │ │ │ Application Configuration ---> │ │ │ └───────────────────────────────────────────────────────────────────────────┘ │ ├───────────────────────────────────────────────────────────────────────────────┤ │ <Select> < Exit > < Help > < Save > < Load > │ └───────────────────────────────────────────────────────────────────────────────┘
#
# Automatically generated file; DO NOT EDIT.
# NuttX/x86_64 Configuration
#
#
# Build Setup
#
CONFIG_HOST_LINUX=y
#
# Build Configuration
#
CONFIG_APPS_DIR="../apps"
CONFIG_BUILD_FLAT=y
#
# Binary Output Formats
#
CONFIG_RAW_BINARY=y
#
# Customize Header Files
#
CONFIG_ARCH_HAVE_STDARG_H=y
CONFIG_ARCH_STDARG_H=y
CONFIG_ARCH_HAVE_SETJMP=y
CONFIG_ARCH_NONE_DEBUG_H=y
#
# Debug Options
#
CONFIG_DEBUG_ALERT=y
CONFIG_ARCH_HAVE_STACKCHECK=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_ARCH_HAVE_CUSTOMOPT=y
CONFIG_DEBUG_FULLOPT=y
#
# System Type
#
CONFIG_ARCH_ARM=y
CONFIG_ARCH="arm"
#
# ARM Options
#
CONFIG_ARCH_CHIP_NRF52=y
CONFIG_ARCH_ARMV7M=y
CONFIG_ARCH_CORTEXM4=y
CONFIG_ARCH_FAMILY="armv7-m"
CONFIG_ARCH_CHIP="nrf52"
CONFIG_ARCH_HAVE_HARDFAULT_DEBUG=y
# CONFIG_DEBUG_HARDFAULT_ALERT is not set
CONFIG_ARCH_HAVE_MEMFAULT_DEBUG=y
# CONFIG_ARM_SEMIHOSTING_SYSLOG is not set
#
# ARMV7M Configuration Options
#
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
CONFIG_ARMV7M_HAVE_STACKCHECK=y
CONFIG_ARMV7M_SYSTICK=y
#
# NRF52 Configuration Options
#
CONFIG_ARCH_CHIP_NRF52840=y
CONFIG_ARCH_FAMILY_NRF52=y
CONFIG_NRF52_HAVE_ACL=y
CONFIG_NRF52_HAVE_UART1=y
CONFIG_NRF52_HAVE_PORT1=y
CONFIG_NRF52_HAVE_SPI3_MASTER=y
CONFIG_NRF52_HAVE_QSPI=y
CONFIG_NRF52_HAVE_USBDEV=y
CONFIG_NRF52_HAVE_PWM3=y
CONFIG_NRF52_HAVE_CRYPTOCELL=y
CONFIG_NRF52_UART=y
#
# NRF52 Peripheral Selection
#
CONFIG_NRF52_UART0=y
CONFIG_NRF52_UART1=y
#
# Clock Configuration
#
#
# System Timer
#
CONFIG_NRF52_SYSTIMER=y
CONFIG_NRF52_SYSTIMER_SYSTICK=y
CONFIG_NRF52_FLASH_PREFETCH=y
#
# GPIO Interrupt Configuration
#
#
# PWM configuration
#
#
# SAADC Configuration
#
#
# SPI Configuration
#
#
# I2C Master Configuration
#
CONFIG_NRF52_I2C_MASTER_COPY_BUF_SIZE=4
CONFIG_ARCH_BOARD="nrf52840-dk"
CONFIG_ARCH_TOOLCHAIN_GNU=y
#
# Architecture Options
#
CONFIG_ARCH_HAVE_IRQTRIGGER=y
CONFIG_ARCH_HAVE_IRQPRIO=y
CONFIG_ARCH_HAVE_VFORK=y
CONFIG_ARCH_HAVE_FPU=y
CONFIG_ARCH_HAVE_LAZYFPU=y
CONFIG_ARCH_HAVE_RESET=y
CONFIG_ARCH_HAVE_TESTSET=y
CONFIG_ARCH_HAVE_SYSCALL_HOOKS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_HAVE_RAMVECTORS=y
#
# Board Settings
#
CONFIG_BOARD_LOOPSPERMSEC=5500
#
# Interrupt options
#
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=0
CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y
#
# Boot options
#
CONFIG_BOOT_RUNFROMFLASH=y
#
# Boot Memory Configuration
#
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=65535
#
# Board Selection
#
CONFIG_ARCH_BOARD_NRF52840_DK=y
#
# Common Board Options
#
CONFIG_ARCH_HAVE_LEDS=y
CONFIG_ARCH_HAVE_BUTTONS=y
#
# Board-Specific Options
#
#
# Board-Common Options
#
CONFIG_LIB_BOARDCTL=y
CONFIG_BOARDCTL_MKRD=y
#
# RTOS Features
#
CONFIG_DISABLE_OS_API=y
#
# Clocks and Timers
#
CONFIG_ARCH_HAVE_TICKLESS=y
CONFIG_USEC_PER_TICK=10000
CONFIG_CLOCK_MONOTONIC=y
CONFIG_ARCH_HAVE_TIMEKEEPING=y
CONFIG_START_YEAR=2021
CONFIG_START_MONTH=5
CONFIG_START_DAY=18
CONFIG_PREALLOC_TIMERS=4
#
# Tasks and Scheduling
#
CONFIG_INIT_ENTRYPOINT=y
CONFIG_INIT_ARGS=""
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_USERMAIN_STACKSIZE=2048
CONFIG_USERMAIN_PRIORITY=100
CONFIG_RR_INTERVAL=200
CONFIG_TASK_NAME_SIZE=0
CONFIG_MAX_TASKS=16
CONFIG_SCHED_WAITPID=y
#
# Pthread Options
#
CONFIG_PTHREAD_MUTEX_ROBUST=y
#
# Performance Monitoring
#
#
# Files and I/O
#
CONFIG_DEV_CONSOLE=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK=8
CONFIG_FILE_STREAM=y
CONFIG_NAME_MAX=32
CONFIG_PATH_MAX=256
#
# RTOS hooks
#
#
# Signal Configuration
#
CONFIG_SIG_PREALLOC_IRQ_ACTIONS=8
#
# Signal Numbers
#
#
# Standard Signal Numbers
#
CONFIG_SIG_SIGUSR1=1
CONFIG_SIG_SIGUSR2=2
CONFIG_SIG_SIGALRM=3
CONFIG_SIG_PIPE=13
#
# Non-standard Signal Numbers
#
CONFIG_SIG_SIGCONDTIMEDOUT=16
CONFIG_SIG_SIGWORK=17
#
# POSIX Message Queue Options
#
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_MQ_IRQ_MSGS=8
CONFIG_MQ_MAXMSGSIZE=32
#
# Work queue support
#
CONFIG_SCHED_WORKQUEUE=y
CONFIG_WQUEUE_NOTIFIER=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_LPNTHREADS=1
CONFIG_SCHED_LPWORKPRIORITY=100
CONFIG_SCHED_LPWORKSTACKSIZE=2048
#
# Stack and heap information
#
CONFIG_DEFAULT_TASK_STACKSIZE=2048
CONFIG_IDLETHREAD_STACKSIZE=1024
CONFIG_PTHREAD_STACK_MIN=256
CONFIG_PTHREAD_STACK_DEFAULT=2048
#
# Device Drivers
#
CONFIG_DEV_NULL=y
CONFIG_DRVR_MKRD=y
CONFIG_ARCH_HAVE_RDWR_MEM_CPU_RUN=y
#
# Buffering
#
CONFIG_ARCH_HAVE_SPI_BITORDER=y
#
# Timer Driver Support
#
CONFIG_ARCH_HAVE_PWM_MULTICHAN=y
CONFIG_TIMER=y
CONFIG_TIMER_ARCH=y
CONFIG_BCH=y
#
# IO Expander/GPIO Support
#
#
# LCD Driver Support
#
#
# Character/Segment LCD Devices
#
#
# Other LCD-related Devices
#
#
# LED Support
#
CONFIG_NETDEVICES=y
#
# General Ethernet MAC Driver Options
#
CONFIG_NETDEV_TELNET=y
CONFIG_TELNET_RXBUFFER_SIZE=256
CONFIG_TELNET_TXBUFFER_SIZE=256
CONFIG_TELNET_MAXLCLIENTS=8
CONFIG_TELNET_IOTHREAD_PRIORITY=100
CONFIG_TELNET_IOTHREAD_STACKSIZE=1024
#
# External Ethernet MAC Device Support
#
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_UART1_SERIALDRIVER=y
#
# UART0 Configuration
#
CONFIG_UART0_RXBUFSIZE=256
CONFIG_UART0_TXBUFSIZE=256
CONFIG_UART0_BAUD=115200
CONFIG_UART0_BITS=8
CONFIG_UART0_PARITY=0
CONFIG_UART0_2STOP=0
#
# UART1 Configuration
#
CONFIG_UART1_RXBUFSIZE=1024
CONFIG_UART1_TXBUFSIZE=1024
CONFIG_UART1_BAUD=115200
CONFIG_UART1_BITS=8
CONFIG_UART1_PARITY=0
CONFIG_UART1_2STOP=0
#
# System Logging
#
# CONFIG_ARCH_SYSLOG is not set
CONFIG_SYSLOG_MAX_CHANNELS=1
CONFIG_SYSLOG_DEFAULT=y
#
# Networking Support
#
CONFIG_ARCH_HAVE_NET=y
CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y
CONFIG_NET_READAHEAD=y
CONFIG_NET=y
#
# Driver buffer configuration
#
CONFIG_NET_ETH_PKTSIZE=1294
CONFIG_NET_GUARDSIZE=2
#
# Link layer support
#
CONFIG_NET_ETHERNET=y
CONFIG_NET_TUN=y
CONFIG_TUN_NINTERFACES=1
CONFIG_NET_TUN_PKTSIZE=296
CONFIG_NETDEV_LATEINIT=y
#
# Network Device Operations
#
CONFIG_NETDEV_IFINDEX=y
CONFIG_NETDOWN_NOTIFIER=y
#
# Internet Protocol Selection
#
CONFIG_NET_IPv4=y
#
# Socket Support
#
CONFIG_NET_NACTIVESOCKETS=16
CONFIG_NET_SOCKOPTS=y
#
# Raw Socket Support
#
CONFIG_NET_PKT=y
CONFIG_NET_PKT_CONNS=1
#
# Unix Domain Socket Support
#
#
# Rpmsg Socket Support
#
#
# SocketCAN Support
#
#
# Netlink Socket Support
#
CONFIG_NET_NETLINK=y
CONFIG_NETLINK_CONNS=4
#
# Netlink Protocols
#
#
# TCP/IP Networking
#
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_TCP_NPOLLWAITERS=1
CONFIG_NET_TCP_RTO=3
CONFIG_NET_TCP_WAIT_TIMEOUT=120
CONFIG_NET_MAX_LISTENPORTS=20
CONFIG_NET_TCP_FAST_RETRANSMIT_WATERMARK=3
CONFIG_NET_TCP_NOTIFIER=y
#
# UDP Networking
#
CONFIG_NET_UDP=y
CONFIG_NET_UDP_CONNS=8
CONFIG_NET_UDP_NPOLLWAITERS=1
#
# Bluetooth socket support
#
#
# IEEE 802.15.4 socket support
#
#
# ICMP Networking Support
#
#
# ARP Configuration
#
CONFIG_NET_ARP=y
CONFIG_NET_ARPTAB_SIZE=16
CONFIG_NET_ARP_MAXAGE=120
#
# User-space networking stack API
#
#
# Network Topologies
#
#
# Routing Table Configuration
#
CONFIG_NET_ROUTE=y
CONFIG_ROUTE_IPv4_RAMROUTE=y
CONFIG_ROUTE_MAX_IPv4_RAMROUTES=4
#
# Crypto API
#
# CONFIG_CRYPTO is not set
#
# File Systems
#
#
# File system configuration
#
CONFIG_FS_NEPOLL_DESCRIPTORS=8
CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
CONFIG_FS_MQUEUE_NPOLLWAITERS=4
#
# Partition Table
#
CONFIG_FS_FAT=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_MAXFNAME=32
CONFIG_FAT_LFN_ALIAS_TRAILCHARS=0
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
#
# Exclude individual procfs entries
#
CONFIG_FS_PROCFS_EXCLUDE_ENVIRON=y
#
# Graphics Support
#
#
# Font Cache Pixel Depths
#
CONFIG_NXFONTS_PACKEDMSFIRST=y
#
# Memory Management
#
CONFIG_MM_DEFAULT_MANAGER=y
CONFIG_MM_REGIONS=2
#
# Common I/O Buffer Support
#
CONFIG_MM_IOB=y
CONFIG_IOB_NBUFFERS=24
CONFIG_IOB_BUFSIZE=196
CONFIG_IOB_NCHAINS=24
CONFIG_IOB_THROTTLE=0
CONFIG_IOB_NOTIFIER=y
CONFIG_IOB_NOTIFIER_DIV=4
#
# Audio Support
#
# CONFIG_AUDIO is not set
#
# Video Support
#
#
# Video subsystem
#
#
# Wireless Support
#
#
# Binary Loader
#
#
# Library Routines
#
#
# Standard C Library Options
#
#
# Standard C I/O
#
CONFIG_STDIO_BUFFER_SIZE=64
CONFIG_STDIO_LINEBUFFER=y
CONFIG_NUNGET_CHARS=2
CONFIG_LIBC_LONG_LONG=y
CONFIG_EOL_IS_EITHER_CRLF=y
#
# Architecture-Specific Support
#
CONFIG_ARCH_LOWPUTC=y
#
# stdlib Options
#
CONFIG_LIB_RAND_ORDER=1
CONFIG_LIB_HOMEDIR="/"
CONFIG_LIBC_TMPDIR="/tmp"
CONFIG_LIBC_MAX_TMPFILE=32
#
# Program Execution Options
#
CONFIG_SYMTAB_ORDEREDBYNAME=y
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
CONFIG_LIB_HOSTNAME=""
#
# errno Decode Support
#
#
# memcpy/memset Options
#
#
# pthread support
#
#
# Time/Time Zone Support
#
#
# Thread Local Storage (TLS)
#
# CONFIG_TLS_ALIGNED is not set
CONFIG_TLS_NELEM=4
#
# Network-Related Options
#
CONFIG_LIBC_NETDB=y
#
# NETDB Support
#
CONFIG_NETDB_BUFSIZE=256
CONFIG_NETDB_MAX_IPADDR=1
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDB_DNSCLIENT_ENTRIES=8
CONFIG_NETDB_DNSCLIENT_NAMESIZE=32
CONFIG_NETDB_DNSCLIENT_LIFESEC=3600
CONFIG_NETDB_DNSCLIENT_MAXRESPONSE=256
CONFIG_NETDB_DNSCLIENT_RECV_TIMEOUT=30
CONFIG_NETDB_DNSCLIENT_RETRIES=3
CONFIG_NETDB_DNSSERVER_NAMESERVERS=1
CONFIG_NETDB_DNSSERVER_IPv4=y
CONFIG_NETDB_DNSSERVER_IPv4ADDR=0x0a000001
CONFIG_LIB_SENDFILE_BUFSIZE=512
#
# Non-standard Library Support
#
CONFIG_BUILTIN=y
#
# Library Debugging
#
#
# Basic CXX Support
#
CONFIG_HAVE_CXX=y
CONFIG_NUTTX_LIBXX=y
CONFIG_HAVE_CXXINITIALIZE=y
#
# Open Asymmetric Multi Processing
#
#
# Application Configuration
#
#
# CAN Utilities
#
#
# Examples
CONFIG_EXAMPLES_PPPD_STACKSIZE=2048
#
# File System Utilities
#
CONFIG_FSUTILS_MKFATFS=y
#
# GPS Utilities
#
#
# Graphics Support
#
#
# NxWidgets
#
#
# NxWM
#
#
# Industrial Applications
#
#
# Interpreters
#
#
# FreeModBus
#
# CONFIG_MODBUS is not set
#
# Network Utilities
#
CONFIG_NETUTILS_CHAT=y
CONFIG_NETUTILS_NETCAT=y
CONFIG_NETUTILS_NETCAT_PROGNAME="netcat"
CONFIG_NETUTILS_NETCAT_PRIORITY=100
CONFIG_NETUTILS_NETCAT_STACKSIZE=2048
CONFIG_NETUTILS_NETINIT=y
CONFIG_NETINIT_NETLOCAL=y
#
# IP Address Configuration
#
#
# IPv4 Addresses
#
CONFIG_NETINIT_IPADDR=0x0a000002
CONFIG_NETINIT_DRIPADDR=0x0a000001
CONFIG_NETINIT_NETMASK=0xffffff00
CONFIG_NETUTILS_NETLIB=y
CONFIG_NETUTILS_PPPD=y
CONFIG_NETUTILS_PPPD_PAP=y
CONFIG_NETUTILS_TELNETC=y
CONFIG_NETUTILS_TELNETD=y
#
# NSH Library
#
CONFIG_NSH_LIBRARY=y
#
# Command Line Configuration
#
CONFIG_NSH_PROMPT_STRING="nsh> "
CONFIG_NSH_READLINE=y
CONFIG_NSH_LINELEN=64
CONFIG_NSH_QUOTE=y
CONFIG_NSH_CMDPARMS=y
CONFIG_NSH_MAXARGUMENTS=7
CONFIG_NSH_ARGCAT=y
CONFIG_NSH_NESTDEPTH=3
CONFIG_NSH_BUILTIN_APPS=y
#
# Disable Individual commands
#
CONFIG_NSH_DISABLE_DATE=y
CONFIG_NSH_DISABLE_IFUPDOWN=y
CONFIG_NSH_DISABLE_LOSMART=y
CONFIG_NSH_DISABLE_MB=y
CONFIG_NSH_DISABLE_MH=y
CONFIG_NSH_DISABLE_MW=y
CONFIG_NSH_DISABLE_PRINTF=y
CONFIG_NSH_DISABLE_TRUNCATE=y
CONFIG_NSH_MMCSDMINOR=0
#
# Configure Command Options
#
CONFIG_NSH_CODECS_BUFSIZE=128
CONFIG_NSH_CMDOPT_HEXDUMP=y
CONFIG_NSH_PROC_MOUNTPOINT="/proc"
CONFIG_NSH_FILEIOSIZE=512
#
# Scripting Support
#
# CONFIG_NSH_DISABLESCRIPT is not set
# CONFIG_NSH_DISABLE_ITEF is not set
# CONFIG_NSH_DISABLE_LOOPS is not set
#
# Console Configuration
#
CONFIG_NSH_CONSOLE=y
CONFIG_NSH_ARCHINIT=y
#
# Networking Configuration
#
CONFIG_NSH_NETINIT=y
CONFIG_NSH_WGET_BUFF_SIZE=512
#
# Telnet Configuration
#
CONFIG_NSH_TELNET=y
CONFIG_NSH_TELNETD_PORT=23
CONFIG_NSH_TELNETD_DAEMONPRIO=100
CONFIG_NSH_TELNETD_DAEMONSTACKSIZE=2048
CONFIG_NSH_TELNETD_CLIENTPRIO=100
CONFIG_NSH_TELNETD_CLIENTSTACKSIZE=2048
CONFIG_NSH_IOBUFFER_SIZE=512
#
# Platform-specific Support
#
# CONFIG_PLATFORM_CONFIGDATA is not set
#
# System Libraries and NSH Add-Ons
#
#
# libuv async i/o Library
#
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_PRIORITY=100
CONFIG_SYSTEM_NSH_STACKSIZE=2048
CONFIG_SYSTEM_NSH_PROGNAME="nsh"
CONFIG_READLINE_HAVE_EXTMATCH=y
CONFIG_SYSTEM_READLINE=y
CONFIG_READLINE_ECHO=y
CONFIG_SYSTEM_TEE=y
CONFIG_SYSTEM_TEE_STACKSIZE=1536
CONFIG_SYSTEM_TEE_PRIORITY=100
CONFIG_SYSTEM_TELNET_CLIENT=y
CONFIG_SYSTEM_TELNET_CLIENT_PROGNAME="telnet"
CONFIG_SYSTEM_TELNET_CLIENT_STACKSIZE=2048
CONFIG_SYSTEM_TELNET_CLIENT_PRIORITY=100
CONFIG_SYSTEM_UBLOXMODEM=y
CONFIG_SYSTEM_UBLOXMODEM_TTY_DEVNODE="/dev/ttyS1"
CONFIG_SYSTEM_UBLOXMODEM_DEVNODE="/dev/ubxmdm"
#
# Testing
#
#
#
# Wireless Libraries and NSH Add-Ons
#
#
# Bluetooth applications
#
#
# IEEE 802.15.4 applications
#
Você pode pesquisar os itens de configuração pressionando "/" na tela do menu. Você também pode
pular para esse menu digitando um número como "(1)" no lado esquerdo dos resultados da pesquisa.
Além da customização, foi necessário configurar o modem U-blox SARA G450 com os seguintes parâmetros
static FAR const char connect_script[] =
"ECHO ON "
"TIMEOUT 30 "
"\"\" ATE1 "
"OK AT+CMEE=2 "
"OK AT+UPSD=0,1,\\\"claro.com.br\\\" "
"OK AT+UDCONF=0,0 "
"OK AT+CGDCONT=1,\\\"IP\\\",\\\"claro.com.br\\\" "
"OK ATD*99***1# "
"CONNECT \\c";
ACESSO ÀS GPIOS DO U-blox NINA B302
Após alterar a configuração, não esqueça de configurar o TXD e RXD....acordo com o board.h que se encontra em /home/osboxes/nuttx/nuttx/boards/arm/nrf52/nrf52840-dk/include Os pinos TXD e RXD que são utilizados para comunicação com o terminal são
P1.13 e P0.29, os mesmos GPIO22 e GPIO23 no encapsulamento do NINA B302
/* UART Pins ****************************************************************/
/* UART0 is connected to the virtual COM port: Nuttx Console
* UART0_RX - P0-29 IO22
* UART0_TX - P1-13 IO21
*/
#define BOARD_UART0_TX_PIN (GPIO_INPUT | GPIO_PORT1 | GPIO_PIN(13))
#define BOARD_UART0_RX_PIN (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN(29))
/* UART1 - MODEM GSM
* UART1_RX - P0.14 IO2
* UART1_TX - P0.13 IO1
*/
#define BOARD_UART1_RX_PIN (GPIO_INPUT | GPIO_PORT0 | GPIO_PIN(14))
#define BOARD_UART1_TX_PIN (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN(13))
...faça então o make, escreva a imagem e abra o nsh novamente.
make[3]: Leaving directory '/home/osboxes/nuttx/apps/system/readline' make[2]: Leaving directory '/home/osboxes/nuttx/apps' make[1]: Leaving directory '/home/osboxes/nuttx/apps' IN: /home/osboxes/nuttx/apps/libapps.a -> staging/libapps.a make[1]: Entering directory '/home/osboxes/nuttx/nuttx/fs' make[1]: 'libfs.a' is up to date. make[1]: Leaving directory '/home/osboxes/nuttx/nuttx/fs' make[1]: Entering directory '/home/osboxes/nuttx/nuttx/binfmt' make[1]: 'libbinfmt.a' is up to date. make[1]: Leaving directory '/home/osboxes/nuttx/nuttx/binfmt' make[1]: Entering directory '/home/osboxes/nuttx/nuttx/arch/arm/src' make[2]: Entering directory '/home/osboxes/nuttx/nuttx/boards/arm/nrf52/nrf52840-dk/src' make[2]: 'libboard.a' is up to date. make[2]: Leaving directory '/home/osboxes/nuttx/nuttx/boards/arm/nrf52/nrf52840-dk/src' LD: nuttx make[1]: Leaving directory '/home/osboxes/nuttx/nuttx/arch/arm/src' CP: nuttx.bin
Após compilar, será gerado um BIN, o mesmo deve ser gravado no endereço zero do NINA B302.Abra então o TERATERM (115200,N,8.1)
TESTANDO NO NINA B302nsh> ping www.terra.com.br PING 23.67.77.32 56 bytes of data 56 bytes from 23.67.77.32: icmp_seq=0 time=510 ms 56 bytes from 23.67.77.32: icmp_seq=1 time=640 ms 56 bytes from 23.67.77.32: icmp_seq=2 time=770 ms 56 bytes from 23.67.77.32: icmp_seq=3 time=720 ms 56 bytes from 23.67.77.32: icmp_seq=4 time=670 ms 56 bytes from 23.67.77.32: icmp_seq=5 time=630 ms 56 bytes from 23.67.77.32: icmp_seq=6 time=780 ms 56 bytes from 23.67.77.32: icmp_seq=7 time=730 ms 56 bytes from 23.67.77.32: icmp_seq=8 time=680 ms 56 bytes from 23.67.77.32: icmp_seq=9 time=640 ms 10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
Sobre a SMARTCORE
Nenhum comentário:
Postar um comentário