nRF5340 BLE: How to create the rpmsg_nrf53_sram in partitions.yml during porting the sample 'peripheral_uart'

Hi Support Team,

I try to use BLE in 'Split Controller and Host' mode on nRF5340 DK. I ported the sample 'peripheral_uart' for appCore and 'hci_rpmsg' for netCore, and the bidirectional communication between the appCore's terminal and 'nRF Connect for Mobile' APP is successful.

But, strangely, the partitions.yml in my project and the one in the sample are different in the SRAM section.
my partitions.yml:

sram_primary:
  address: 0x20000000
  end_address: 0x20080000
  region: sram_primary
  size: 0x80000

The sample's: 

rpmsg_nrf53_sram:
  address: 0x20070000
  end_address: 0x20080000
  placement:
    before:
    - end
  region: sram_primary
  size: 0x10000
  
  sram_primary:
  address: 0x20000000
  end_address: 0x20070000
  region: sram_primary
  size: 0x70000

My questions:
1. In my understanding, the rpmsg_nrf53_sram is for RPMsg transport and is a must for BLE in 'Split Controller and Host' mode. Why there is no rpmsg_nrf53_sram in my partitions.yml, but the communication is still ok?
2. How can I create the rpmsg_nrf53_sram in my partition and let it be shared by the appCore and the netCore?
Thank you very much.

Best regards,
Yanpeng Wu

Parents
  • Hello Yanpeng,

    Could you provide a bit more information about how your project setup differs from the peripheral_uart sample? Do you still use the same hci_rpmsg child image in your build? The 'rpmsg_nrf53_sram' section should be added automatically by the build script here: https://github.com/nrfconnect/sdk-nrf/blob/d5a11bd8bd803fff7615f9b0c5227a60c761da27/subsys/partition_manager/CMakeLists.txt#L87 

    Best regards,

    Vidar

  • Hello Vidar,

    Thank you for your reply. I'm not using the original hci_rpmsg child image. In my application, I'm using a sysbuild and there is another small task on netCore, so I ported the code of hci_rpmsg to my application code on the netCore.

    In the sample peripheral_uart, I did not find how it define the hci_rpmsg as its default child image. I guessed it should be the configuration 'config NRF_DEFAULT_BLUETOOTH  default y' in the Kconfig.sysbuild, is it correct?

    After I ported the code to my application, the first build had some errors with the flash partition, then I added the cmake argument '-Dhci_rpmsg_OVERLAY_CONFIG="C:/ncs/v2.5.2/nrf/subsys/partition_manager/partition_manager_enabled.conf"', just as the sample did. After this, the BLE communication is ok, but when I compare the partitions.yml files in the sample and my project, I found the difference of rpmsg_nrf53_sram.

    Best regards,
    Yanpeng Wu

  • Hi Yanpeng,

    'hci_rpmsg' is included as a child image by default when you enable Bluetoot in the parent application running on the application core. This is controlled by the CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE symbol.

    Best regards,

    Vidar

  • Hi Vidar,

    Thanks for the quick reply.
    In my project, I unchecked the 'Use sysbuild' in the Build Configuration, and found the image on netCore became 'hci_rpmsg', but still no 'rpmsg_nrf53_sram' in the partitions.yml.
    In the build log, there is 'Dropping partition 'rpmsg_nrf53_sram' since its size is 0.'

    I compared the CMakelists.txt in my project and the 'peripheral_uart', and did not find any difference for this. Maybe I missed something in my appCore build script...?

    Best regards,
    Yanpeng Wu

  • Hi Yanpeng,

    Yanpengwu said:
    I compared the CMakelists.txt in my project and the 'peripheral_uart', and did not find any difference for this.

    Please compare the prj.conf settings instead and make sure you haven't set the CONFIG_RPMSG_NRF53_SRAM_SIZE symbol.

    Best regards,

    Vidar

  • Hi Vidar,

    I checked my prj.conf, there is no CONFIG_RPMSG_NRF53_SRAM_SIZE symbol.

    I saw this symbol is dependent on CONFIG_PARTITION_MANAGER_ENABLED. I enabled it with cmake argument '-Dhci_rpmsg_OVERLAY_CONFIG="C:/ncs/v2.5.2/nrf/subsys/partition_manager/partition_manager_enabled.conf"', just as the sample 'peripheral_uart' did.

    I attached my prj.conf for your information, in case there are conflicts inside.

    my prj.conf

    Best regards,

    Yanpeng Wu

  • Update: 
    I enabled the IPC communication in my project currently. Maybe this part caused some conflicts?
    In prj.conf:

    # IPC communication
    CONFIG_IPC_SERVICE=y
    CONFIG_IPC_SERVICE_BACKEND_ICMSG=y
    CONFIG_MBOX=y

    In boards\nrf5340dk_nrf5340_cpuapp.overlay:
    reserved-memory {
    		/delete-node/ memory@20070000;
    
    		sram_tx: memory@20070000 {
    			reg = <0x20070000 0x400>;
    		};
    
    		sram_rx: memory@20078000 {
    			reg = <0x20078000 0x0800>;
    		};
    	};
    
    	ipc {
    		/delete-node/ ipc0;
    
    		ipc0: ipc0 {
    			compatible = "zephyr,ipc-icmsg";
    			tx-region = <&sram_tx>;
    			rx-region = <&sram_rx>;
    			mboxes = <&mbox 0>, <&mbox 1>;
    			mbox-names = "tx", "rx";
    			status = "okay";
    		};
    	};
    

    When I remove these codes and build, there is still no rpmsg_nrf53_sram in the partitions.yml. And the system behavior changed:

    (1). When I disconnect the BLE connection on the app 'nRF Connect for Mobile', the system does not crash as ASSERTION FAIL with opcode-0x200a-timeout.

    (2). The nr5340 DK only can receive data via BLE, when it sends data, it fails when calling bt_nus_send(), and the trace is "Failed to send data over BLE connection".

Reply
  • Update: 
    I enabled the IPC communication in my project currently. Maybe this part caused some conflicts?
    In prj.conf:

    # IPC communication
    CONFIG_IPC_SERVICE=y
    CONFIG_IPC_SERVICE_BACKEND_ICMSG=y
    CONFIG_MBOX=y

    In boards\nrf5340dk_nrf5340_cpuapp.overlay:
    reserved-memory {
    		/delete-node/ memory@20070000;
    
    		sram_tx: memory@20070000 {
    			reg = <0x20070000 0x400>;
    		};
    
    		sram_rx: memory@20078000 {
    			reg = <0x20078000 0x0800>;
    		};
    	};
    
    	ipc {
    		/delete-node/ ipc0;
    
    		ipc0: ipc0 {
    			compatible = "zephyr,ipc-icmsg";
    			tx-region = <&sram_tx>;
    			rx-region = <&sram_rx>;
    			mboxes = <&mbox 0>, <&mbox 1>;
    			mbox-names = "tx", "rx";
    			status = "okay";
    		};
    	};
    

    When I remove these codes and build, there is still no rpmsg_nrf53_sram in the partitions.yml. And the system behavior changed:

    (1). When I disconnect the BLE connection on the app 'nRF Connect for Mobile', the system does not crash as ASSERTION FAIL with opcode-0x200a-timeout.

    (2). The nr5340 DK only can receive data via BLE, when it sends data, it fails when calling bt_nus_send(), and the trace is "Failed to send data over BLE connection".

Children
Related