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

    Please check out this case for an easy explanation of how to port PCA10056 examples to pca10100. For a Keil project, use the .uvprojx files.

    Best regards,

    Simon

  • Thank you for the suggestion.  I tried using the working PCA10100 UART example to modify the PCA10056 libuarte example with modifying the .uvprojx file.  There are quite a few differences, and if I make too many changes I will get build errors, and trying various other combinations I can build and flash without errors, but the 52833 does not respond over the UART port.  If I flash back the the original PCA10100 example, it continues to work so I believe my toolchain and hardware setup is working.  Some questions:

    1. Is there a closer example to libuarte written for the PCA10100 that I can reference?

    2. Would using the Segger IDE instead make this process easier?

    3. What would be the best way to quickly debug the situation?

    Thanks,

    Wilbur

  • Hi Wilbur

    1. No, I'm sorry. There aren't any that are closer to the libuarte than the one existing for pca10056, as it shouldn't be a big job to port a pca10056 project to pca10100. 

    2. That shouldn't make a difference as far as I know. Changing the solution and project name, the linker size, target device, and the flash/RAM settings (as done in this guide), should be sufficient. WHat kinds of errors are you seeing when trying to build?

    3. If you're only seeing build errors, you should follow those to the code lines they're pointing at. If you're struggling to understand some of them, let me know what they say and I'll try to help you with this.

    Best regards,

    Simon

  • Hi Simon,

    Thanks for the input, I currently don't see any build errors, only the PCA10100 does not respond on the UART port after up update the flash. I currently believe I just need to modify for the right settings for converting from the PCA10056 example.  Could you comment on the following settings to modify for the PCA10100?  I've tried several modifications but have been unsuccessful so far.

    From libuarte_pca10056.uvprojx
    <Cads>
    <Define> APP_TIMER_V2 APP_TIMER_V2_RTC1_ENABLED BOARD_PCA10056 BSP_DEFINES_ONLY CONFIG_GPIO_AS_PINRESET FLOAT_ABI_HARD NRF52840_XXAA __HEAP_SIZE=8192 __STACK_SIZE=8192</Define>

    <Aads>
    <MiscControls> --cpreproc_opts=-DAPP_TIMER_V2,-DAPP_TIMER_V2_RTC1_ENABLED,-DBOARD_PCA10056,-DBSP_DEFINES_ONLY,-DCONFIG_GPIO_AS_PINRESET,-DFLOAT_ABI_HARD,-DNRF52840_XXAA,-D__HEAP_SIZE=8192,-D__STACK_SIZE=8192</MiscControls>
    <Define> APP_TIMER_V2 APP_TIMER_V2_RTC1_ENABLED BOARD_PCA10056 BSP_DEFINES_ONLY CONFIG_GPIO_AS_PINRESET FLOAT_ABI_HARD NRF52840_XXAA __HEAP_SIZE=8192 __STACK_SIZE=8192</Define>

    From uart_pca10100.uvprojx that is working:
    <Cads>
    <Define> BOARD_PCA10100 BSP_DEFINES_ONLY CONFIG_GPIO_AS_PINRESET FLOAT_ABI_HARD NRF52833_XXAA __HEAP_SIZE=8192 __STACK_SIZE=8192</Define>
    <Aads>
    <MiscControls> --cpreproc_opts=-DBOARD_PCA10100,-DBSP_DEFINES_ONLY,-DCONFIG_GPIO_AS_PINRESET,-DFLOAT_ABI_HARD,-DNRF52833_XXAA,-D__HEAP_SIZE=8192,-D__STACK_SIZE=8192</MiscControls>
    <Define> BOARD_PCA10100 BSP_DEFINES_ONLY CONFIG_GPIO_AS_PINRESET FLOAT_ABI_HARD NRF52833_XXAA __HEAP_SIZE=8192 __STACK_SIZE=8192</Define>

    Note that the heap size and stack size is still 8192 for the uart_pca10100.uvprojx, while the ble_app_uart_pca10100_s140.uvprojx the heap size and stack size is 2048 from the case you referenced.  I did try both sizes.

    Thank you in advance for your assistance!

    Best regards,

    Wilbur

  • Hi again

    It's likely just a minor change that is missing somewhere in your ported project file. First, compare the pca10100 UART project file with the pca10056 UART project file and note the differences between the two. Then make the according changes to your libuarte project file, and double check.

    It's important that all instances of pca10056 is changed to pca10100, and all mentions of 52840 is changed to 52833. I also checked with Hung (who suggested this method for SEGGER, and it should not be any difference in the approach on Keil.

    Best regards,

    Simon

Related