Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Serial / UARTE with S140 soft device

Does the serial function operate with a soft device.  Whenever i have an include statement for serial.h in a file with a softdevice I get a No such file or directory compilation error. In the main file can open declaration etc. Can also specifically add an include path without changing compilation error.  If i just compile the serial example then all is ok. 

Using a nRF52840 I need two UARTs services if required to use UARTE instead of serial how do you specifically configure and use the device?

Parents
  • I have attached a screenshot of the issue.  I have compiled and successfully run the serial example in SDK revision 15 using the updated files in NRF52840 UART1 not working in SDK 14 and have ensured that the configuration file in the buttonless DFU config for UARTE/UART is equivalent to the

    // <e> NRFX_UARTE_ENABLED - nrfx_uarte - UARTE peripheral driver
    //==========================================================
    #ifndef NRFX_UARTE_ENABLED
    #define NRFX_UARTE_ENABLED 1
    #endif
    // <o> NRFX_UARTE0_ENABLED - Enable UARTE0 instance 
    #ifndef NRFX_UARTE0_ENABLED
    #define NRFX_UARTE0_ENABLED 1
    #endif
    
    // <o> NRFX_UARTE1_ENABLED - Enable UARTE1 instance 
    #ifndef NRFX_UARTE1_ENABLED
    #define NRFX_UARTE1_ENABLED 1
    #endif
    
    // <o> NRFX_UARTE_DEFAULT_CONFIG_HWFC  - Hardware Flow Control
     
    // <0=> Disabled 
    // <1=> Enabled 
    
    #ifndef NRFX_UARTE_DEFAULT_CONFIG_HWFC
    #define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0
    #endif
    
    // <o> NRFX_UARTE_DEFAULT_CONFIG_PARITY  - Parity
     
    // <0=> Excluded 
    // <14=> Included 
    
    #ifndef NRFX_UARTE_DEFAULT_CONFIG_PARITY
    #define NRFX_UARTE_DEFAULT_CONFIG_PARITY 0
    #endif
    
    // <o> NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE  - Default Baudrate
     
    // <323584=> 1200 baud 
    // <643072=> 2400 baud 
    // <1290240=> 4800 baud 
    // <2576384=> 9600 baud 
    // <3862528=> 14400 baud 
    // <5152768=> 19200 baud 
    // <7716864=> 28800 baud 
    // <8388608=> 31250 baud 
    // <10289152=> 38400 baud 
    // <15007744=> 56000 baud 
    // <15400960=> 57600 baud 
    // <20615168=> 76800 baud 
    // <30801920=> 115200 baud 
    // <61865984=> 230400 baud 
    // <67108864=> 250000 baud 
    // <121634816=> 460800 baud 
    // <251658240=> 921600 baud 
    // <268435456=> 1000000 baud 
    
    #ifndef NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE
    #define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE 30801920
    #endif
    
    // <o> NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY
    #define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY 7
    #endif
    
    // <e> NRFX_UARTE_CONFIG_LOG_ENABLED - Enables logging in the module.
    //==========================================================
    #ifndef NRFX_UARTE_CONFIG_LOG_ENABLED
    #define NRFX_UARTE_CONFIG_LOG_ENABLED 0
    #endif
    // <o> NRFX_UARTE_CONFIG_LOG_LEVEL  - Default Severity level
     
    // <0=> Off 
    // <1=> Error 
    // <2=> Warning 
    // <3=> Info 
    // <4=> Debug 
    
    #ifndef NRFX_UARTE_CONFIG_LOG_LEVEL
    #define NRFX_UARTE_CONFIG_LOG_LEVEL 3
    #endif
    
    // <o> NRFX_UARTE_CONFIG_INFO_COLOR  - ANSI escape code prefix.
     
    // <0=> Default 
    // <1=> Black 
    // <2=> Red 
    // <3=> Green 
    // <4=> Yellow 
    // <5=> Blue 
    // <6=> Magenta 
    // <7=> Cyan 
    // <8=> White 
    
    #ifndef NRFX_UARTE_CONFIG_INFO_COLOR
    #define NRFX_UARTE_CONFIG_INFO_COLOR 0
    #endif
    
    // <o> NRFX_UARTE_CONFIG_DEBUG_COLOR  - ANSI escape code prefix.
     
    // <0=> Default 
    // <1=> Black 
    // <2=> Red 
    // <3=> Green 
    // <4=> Yellow 
    // <5=> Blue 
    // <6=> Magenta 
    // <7=> Cyan 
    // <8=> White 
    
    #ifndef NRFX_UARTE_CONFIG_DEBUG_COLOR
    #define NRFX_UARTE_CONFIG_DEBUG_COLOR 0
    #endif
    
    // </e>
    
    // </e>
    
    // <e> NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver
    //==========================================================
    #ifndef NRFX_UART_ENABLED
    #define NRFX_UART_ENABLED 1
    #endif
    // <o> NRFX_UART0_ENABLED - Enable UART0 instance 
    #ifndef NRFX_UART0_ENABLED
    #define NRFX_UART0_ENABLED 1
    #endif
    
    // <o> NRFX_UART_DEFAULT_CONFIG_HWFC  - Hardware Flow Control
     
    // <0=> Disabled 
    // <1=> Enabled 
    
    #ifndef NRFX_UART_DEFAULT_CONFIG_HWFC
    #define NRFX_UART_DEFAULT_CONFIG_HWFC 0
    #endif
    
    // <o> NRFX_UART_DEFAULT_CONFIG_PARITY  - Parity
     
    // <0=> Excluded 
    // <14=> Included 
    
    #ifndef NRFX_UART_DEFAULT_CONFIG_PARITY
    #define NRFX_UART_DEFAULT_CONFIG_PARITY 0
    #endif
    
    // <o> NRFX_UART_DEFAULT_CONFIG_BAUDRATE  - Default Baudrate
     
    // <323584=> 1200 baud 
    // <643072=> 2400 baud 
    // <1290240=> 4800 baud 
    // <2576384=> 9600 baud 
    // <3866624=> 14400 baud 
    // <5152768=> 19200 baud 
    // <7729152=> 28800 baud 
    // <8388608=> 31250 baud 
    // <10309632=> 38400 baud 
    // <15007744=> 56000 baud 
    // <15462400=> 57600 baud 
    // <20615168=> 76800 baud 
    // <30924800=> 115200 baud 
    // <61845504=> 230400 baud 
    // <67108864=> 250000 baud 
    // <123695104=> 460800 baud 
    // <247386112=> 921600 baud 
    // <268435456=> 1000000 baud 
    
    #ifndef NRFX_UART_DEFAULT_CONFIG_BAUDRATE
    #define NRFX_UART_DEFAULT_CONFIG_BAUDRATE 30924800
    #endif
    
    // <o> NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY
    #define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 7
    #endif
    
    // <e> NRFX_UART_CONFIG_LOG_ENABLED - Enables logging in the module.
    //==========================================================
    #ifndef NRFX_UART_CONFIG_LOG_ENABLED
    #define NRFX_UART_CONFIG_LOG_ENABLED 0
    #endif
    // <o> NRFX_UART_CONFIG_LOG_LEVEL  - Default Severity level
     
    // <0=> Off 
    // <1=> Error 
    // <2=> Warning 
    // <3=> Info 
    // <4=> Debug 
    
    #ifndef NRFX_UART_CONFIG_LOG_LEVEL
    #define NRFX_UART_CONFIG_LOG_LEVEL 3
    #endif
    
    // <o> NRFX_UART_CONFIG_INFO_COLOR  - ANSI escape code prefix.
     
    // <0=> Default 
    // <1=> Black 
    // <2=> Red 
    // <3=> Green 
    // <4=> Yellow 
    // <5=> Blue 
    // <6=> Magenta 
    // <7=> Cyan 
    // <8=> White 
    
    #ifndef NRFX_UART_CONFIG_INFO_COLOR
    #define NRFX_UART_CONFIG_INFO_COLOR 0
    #endif
    
    // <o> NRFX_UART_CONFIG_DEBUG_COLOR  - ANSI escape code prefix.
     
    // <0=> Default 
    // <1=> Black 
    // <2=> Red 
    // <3=> Green 
    // <4=> Yellow 
    // <5=> Blue 
    // <6=> Magenta 
    // <7=> Cyan 
    // <8=> White 
    
    #ifndef NRFX_UART_CONFIG_DEBUG_COLOR
    #define NRFX_UART_CONFIG_DEBUG_COLOR 0
    #endif
    
    // </e>
    
    // </e>
    
    // <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
    //==========================================================
    #ifndef UART_ENABLED
    #define UART_ENABLED 1
    #endif
    // <o> UART_DEFAULT_CONFIG_HWFC  - Hardware Flow Control
     
    // <0=> Disabled 
    // <1=> Enabled 
    
    #ifndef UART_DEFAULT_CONFIG_HWFC
    #define UART_DEFAULT_CONFIG_HWFC 0
    #endif
    
    // <o> UART_DEFAULT_CONFIG_PARITY  - Parity
     
    // <0=> Excluded 
    // <14=> Included 
    
    #ifndef UART_DEFAULT_CONFIG_PARITY
    #define UART_DEFAULT_CONFIG_PARITY 0
    #endif
    
    // <o> UART_DEFAULT_CONFIG_BAUDRATE  - Default Baudrate
     
    // <323584=> 1200 baud 
    // <643072=> 2400 baud 
    // <1290240=> 4800 baud 
    // <2576384=> 9600 baud 
    // <3862528=> 14400 baud 
    // <5152768=> 19200 baud 
    // <7716864=> 28800 baud 
    // <10289152=> 38400 baud 
    // <15400960=> 57600 baud 
    // <20615168=> 76800 baud 
    // <30801920=> 115200 baud 
    // <61865984=> 230400 baud 
    // <67108864=> 250000 baud 
    // <121634816=> 460800 baud 
    // <251658240=> 921600 baud 
    // <268435456=> 1000000 baud 
    
    #ifndef UART_DEFAULT_CONFIG_BAUDRATE
    #define UART_DEFAULT_CONFIG_BAUDRATE 30801920
    #endif
    
    // <o> UART_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    
    // <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef UART_DEFAULT_CONFIG_IRQ_PRIORITY
    #define UART_DEFAULT_CONFIG_IRQ_PRIORITY 7
    #endif
    
    // <q> UART_EASY_DMA_SUPPORT  - Driver supporting EasyDMA
     
    
    #ifndef UART_EASY_DMA_SUPPORT
    #define UART_EASY_DMA_SUPPORT 1
    #endif
    
    // <q> UART_LEGACY_SUPPORT  - Driver supporting Legacy mode
     
    
    #ifndef UART_LEGACY_SUPPORT
    #define UART_LEGACY_SUPPORT 0
    #endif
    
    // <e> UART0_ENABLED - Enable UART0 instance
    //==========================================================
    #ifndef UART0_ENABLED
    #define UART0_ENABLED 1
    #endif
    // <q> UART0_CONFIG_USE_EASY_DMA  - Default setting for using EasyDMA
     
    
    #ifndef UART0_CONFIG_USE_EASY_DMA
    #define UART0_CONFIG_USE_EASY_DMA 1
    #endif
    
    // </e>
    
    // <e> UART1_ENABLED - Enable UART1 instance
    //==========================================================
    #ifndef UART1_ENABLED
    #define UART1_ENABLED 1
    #endif
    // </e>
    
    // </e>
    
    // </h> 
    //==========================================================
    

    config in the updated serial example. In my check config file I have  set  NRFX_UARTE_ENABLED = 1.  NRF_SERIAL_ENABLED = 1 was not in the buttonless code but was in the serial example I have added

    // <q> NRF_SERIAL_ENABLED  - nrf_serial - Serial port interface
    
    
    #ifndef NRF_SERIAL_ENABLED
    #define NRF_SERIAL_ENABLED 1
    #endif

  • Have you made sure you have the include path correctly ? Could you take a screenshot of the User Include Directories that show the /components/libraries/serial included in your project (inside Option -> Select Common configuration)

  • I have edited the makefile to include the required paths.  Functions can now be included.  

  • I have added serial functions. Need to ensure that config file is correct.  Start with working serial example as highlighted in link. Add paths in S140 Make File.  Check S140 Config file and update to match serial example for UART /UARTE .  If file has uart logging disable if using UART 0 as will be set for logging.

Reply Children
No Data
Related