This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Two UART example for the nRF52833 DK with SDK17.0.2 for Keil uVision

I am looking for an example where I can enable UARTE0 and UARTE1 on the nRF52833 DK.  I am using nRF5_SDK_17.0.2 with Keil uVision V5.  I am successful with the loopback example in examples > peripheral > uart > pca10100, and looking in the forums I understand that I need to use examples > peripheral > libuarte for the two UART configuration.  Could I get some guidance on how to modify the pca10056 example to work for the pca10100, and ultimately modified to enable the second UART port?  Thank you very much.

  • Hi Simon,

    My J-Link RTT Viewer V6.88a Configuration settings are as follows:
    Connection to J-Link: USB
    Target Device: NRF52833_XXAA
    Target Interface: SWD
    Speed: 4000kHz
    RTT Control Block: Auto Detection

    DEBUG is in the C/C++ Preprocessor Symbols Define.

    I went ahead and re-extracted SDK17.0.2 to a new directory, verified the \examples\peripheral\uart\pca10100 works, and then modified the \examples\peripheral\libuarte\pca10056 uvprojx file with the following steps to match the uart example:

    1. Device: Selected nRF52833_xxAA
    2. Target: Unchecked IRAM2
    3. C/C++ Preprocessor Symbol Define: Changed to reference the target board/device (APP_TIMER_V2 APP_TIMER_V2_RTC1_ENABLED BOARD_PCA10100 BSP_DEFINES_ONLY CONFIG_GPIO_AS_PINRESET FLOAT_ABI_HARD NRF52833_XXAA __HEAP_SIZE=8192 __STACK_SIZE=8192 DEBUG)

    Again, I still have the same behavior where it will not run unless I reset the device. Can you try this with the PCA10100 board and see if you get the same results?  This is running main.c as-is.

    Second question, could the \examples\peripheral\uart example be modified for two UART ports as well?

    Thanks,
    Wilbur

  • Hi Wilbur

    Can you try one more thing. The "standard" project transfer from one board to another, as you might be missing something by comparing the uvprox files. Here are all of the required steps to transfer a project to nRF52833 HW:

    • In the project settings, change to device "NordicSemiconductor->nRF52833_xxaa".
    • Add the preprocessor define "NRF52833_XXAA"
    • In the preprocessor settings, remove the defines "NRF52" and "NRF52840_XXAA".
    • In the linker script settings, adjust the linker script to match the maximum RAM and Flash Memory of the nRF52833.
    • Remove the startup and system files of the current project and add the startup_nrf52833.s and system_nrf52833.c files.

    Best regards,

    Simon

  • Hi Simon,

    Thanks for the detailed steps.  My comments below:

    • In the project settings, change to device "NordicSemiconductor->nRF52833_xxaa".
    • Add the preprocessor define "NRF52833_XXAA"
    • In the preprocessor settings, remove the defines "NRF52" and "NRF52840_XXAA".
    • In the linker script settings, adjust the linker script to match the maximum RAM and Flash Memory of the nRF52833.
    • Remove the startup and system files of the current project and add the startup_nrf52833.s and system_nrf52811.c files.
    • For project settings my device is Nordic Semiconductor nRF52 Series nRF52833_xxaa.
    • My preprocessor defines I have NRF52833_XXAA
    • My preprocessor settings there are no defines for NRF52 and NRF52840_XXAA
    • For Linker, "Use Memory Layout from Target Dialog" is enabled, with R/O Base 0x00000000, R/W Base 0x20000000
    • The files for the project show "arm_startup_nrf52833.s (Startup)" and "system_nrf52833.c (Startup)".  I do not see references to 52811 (I believe you may have a typo) or 52840.

    Would you be able to try this with a PCA10100 on your side to see if you get different results?

    Thanks,

    Wilbur

  • Hi Wilbur

    After some trial and error I got it up and running on an nRF52833 DK (no restart required it seems). Please note that I used SEGGER Embedded Studios and SDK v17.0.2 and not Keil though.

    I followed the steps in my last reply to move from the nRF52840 to nRF52833. There seems to be a few additional things to keep in mind though. For some reason, changing the environment to nRF52833 will cause the linker_section_placements_segments to use FLASH1 instead of FLASH, so that it no longer correlates to the flash_placement.xml file. You also need to make sure to change the Flash size to 0x80000 and RAM size to 0x20000 instead of 0x100000 and 0x40000 in both Memory Segments and Section Placement Macros.

    Best regards,

    Simon

Related