Blinky runs on DK, but not on external Seeed Xiao nRF52840

I am trying to program a Seeed Xiao nRF52840 Sense with a nRF5DK-52832 using the Debug out P20 connector.  I am an experienced embedded systems developer (ESP32, ATTiny/AVR,and some STM), but have little experience of the Nordic products but my client wants to use the Seeed, so I'm on a necessarily steep learning curve. I've done the Getting started course but have yet to master the subtleties of this environment.

I'm using latest VSCode with toolchain 3.2.1 on Windows 11.The SWD interface works OK, I can see the target device change from nRF52832 to nRF52840 when I connect Vtg on the DK to the Seeed's 3.3v line, and I can flash the Arduino bootloader back with nrfutils.

The build process for a modified Blinky compiles, links, erases and uploads successfully on both the DK and the external Seeed, using the relevant board.dts file.  I have two build configurations, one for each environment, and some conditional logic in main.c that changes some output text and the flash rate depending on the compile target.  All that works fine except the code doesn't run on the Seeed board, it just doesn't start. I can see it compiles for a base of 0x27000 though, from other posts here I'm convinced it should be a base of 0.

As per those other posts I've commented out these two lines in the Seeed's board config file:

    CONFIG_BUILD_OUTPUT_UF2=y
    CONFIG_USE_DT_CODE_PARTITION=y
but that made no effect, and the UF2 file still gets generated.
I also tried, as per another post,
     CONFIG_FLASH_LOAD_OFFSET=0

in various .conf files with no apparent effect.

What to try next?

Thanks in anticipation...

Parents
  • Hello,

    I don't have the module in question, but if you set those two kconfig options to =n and it doesn't compile in, then it sounds to me that you need to make sure the change is saved and perform a pristine build (e.g. delete build folder). Instead of modifying the board files directly you can simply put in prj.conf:

        CONFIG_BUILD_OUTPUT_UF2=n
        CONFIG_USE_DT_CODE_PARTITION=n
        CONFIG_FLASH_LOAD_OFFSET=0

    Alternatively try to build for the nrf52840dk for test and program it instead.

    Kenneth

  • Hi Kenneth,

    That partially helped in that it doesn't appear to generate the UF2 file anymore, however the partitions still stay fixed and this seems to be because late in the build, long after any configuration has occurred I see:

    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Users/skype/blinky_seeed/build/blinky_seeed
    -- Found partition manager static configuration : C:/ncs/v3.2.1/zephyr/boards/seeed/xiao_ble/pm_static.yml
    -- Configuring done
    -- Generating done

    which seems to wipe out any previous partition management

    I can compile for the nrf52840dk and that runs but it has the wrong gpio number (13 not 26) so the LED0 doesn't flash (but  oddly dLED2 on P0.06 does weakly).  I used an overlay to change the pin that eventually worked, though the whole thing seems flaky, sometimes the build failed claiming a device driver wasn't found which had nothing to do with the overlay. But that's not a long term solution as I need the USB & UART to work and it seems that's not working without the bootloader installed.

    Or how do I get printk statements out to the PC from the external board - either via the DK or preferably through it own USB port?  because at the moment what comes out on COM12 is from the program on the DK not the external board.

    So, do I need to go back to the default Xiao BLE configuration, with the bootloader in place; I don't need it but it may be the only way to get this to work, or how do I sort the partitioning out so the build doesn't require the bootloader and get the local USB/UART working...?

Reply
  • Hi Kenneth,

    That partially helped in that it doesn't appear to generate the UF2 file anymore, however the partitions still stay fixed and this seems to be because late in the build, long after any configuration has occurred I see:

    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Users/skype/blinky_seeed/build/blinky_seeed
    -- Found partition manager static configuration : C:/ncs/v3.2.1/zephyr/boards/seeed/xiao_ble/pm_static.yml
    -- Configuring done
    -- Generating done

    which seems to wipe out any previous partition management

    I can compile for the nrf52840dk and that runs but it has the wrong gpio number (13 not 26) so the LED0 doesn't flash (but  oddly dLED2 on P0.06 does weakly).  I used an overlay to change the pin that eventually worked, though the whole thing seems flaky, sometimes the build failed claiming a device driver wasn't found which had nothing to do with the overlay. But that's not a long term solution as I need the USB & UART to work and it seems that's not working without the bootloader installed.

    Or how do I get printk statements out to the PC from the external board - either via the DK or preferably through it own USB port?  because at the moment what comes out on COM12 is from the program on the DK not the external board.

    So, do I need to go back to the default Xiao BLE configuration, with the bootloader in place; I don't need it but it may be the only way to get this to work, or how do I sort the partitioning out so the build doesn't require the bootloader and get the local USB/UART working...?

Children
Related