nRF5340 how to Direct test mode in NCS2.0

Hello

NCS2.0.2, nRF5340+nRF21540,  vscode

hwo to do Direct test mode with MT8852B? (PS: i konw how to test nRF52840)

i open the demo from:

C:\ncs\v2.0.2\nrf\samples\bluetooth\direct_test_mode

and add code to open 21540 to 20dB like this,

	gpio_pin_configure_dt(&sp_pdn_21540, GPIO_OUTPUT_ACTIVE);
	gpio_pin_set_dt(&sp_pdn_21540,1);		// high
		gpio_pin_configure_dt(&sp_csn_21540, GPIO_OUTPUT_ACTIVE);
		gpio_pin_set_dt(&sp_csn_21540,1);	// high
	gpio_pin_configure_dt(&sp_rxen_21540, GPIO_OUTPUT_ACTIVE);
	gpio_pin_set_dt(&sp_rxen_21540,1);		// high  enabled
		gpio_pin_configure_dt(&sp_mode_21540, GPIO_OUTPUT_ACTIVE);
		gpio_pin_set_dt(&sp_mode_21540,0);	// low  TX_Gain=POUTA(20dB)
	gpio_pin_configure_dt(&sp_antsel_21540, GPIO_OUTPUT_ACTIVE);
	gpio_pin_set_dt(&sp_antsel_21540,0);	// low ANT1
		gpio_pin_configure_dt(&sp_txen_21540, GPIO_OUTPUT_ACTIVE);
		gpio_pin_set_dt(&sp_txen_21540,1);	// high  enabled


	printk("Starting Direct Test Mode example\n");

nRF5340 is two core, is should choose cpuapp or cpunet? if choose cpuapp, the net core no hex.

   

build cpuapp or cpuapp_ns

  dtm.c:2118:24: error: 'RADIO_IRQn' undeclared

   

update SDK to NCS2.3.0 build error:

(PS:cpoy new project C:\ncs\v2.3.0\nrf\samples\bluetooth\direct_test_mode,   don't chang any code)

build cpuapp or cpuapp_ns

dtm.c:2185:35: error: 'NRF_RADIO' undeclared

build cpunet

main.c:73: undefined reference to `__device_dts_ord_66'

   

Best regards

Parents Reply Children
  • Hi,

    Having a closer look at your design, I realize that you have added an extra circuit for turning the nRF21540 off.
    The nRF21540 has its own PDN pin to put it in low power mode, so for normal operation, you should not need to cut the power of the nRF21540.
    See nRF21540 Pin Assignements.

    Our BLE drivers will automatically use the PDN and other pins to control the FEM if you have it configured on.
    If you manually toggle these pins in your application, you may get unexpected behavior.
    If you cut the power to the nRF21540 in your application, you may get unexpected behavior.

    For normal operation of the nRF21540, I recommend that you do not cut its power by an external circuit.

    My sample sets the PDN pin, which is not the same as your custom power toggle pin.
    So you can not use the sample for this.

    If you want to learn how toggle your power pin manually as a stand-alone pin, you can for example learn how to do this from this unofficial GPIO Device.

    For a guide on how to use the nRF21540, see the Working with RF front-end modules.

    yoyou said:
    does it mean that I should give up using 5340?  switch to ESP32S3, it up to 240MHz, BLE5+WIFI, priced at only one-third of 5340,can choose RAM 8MB FLASH 128MB.     5340 only 128MHz and no wifi.

    For sales related questions, please contact our sales team: https://www.nordicsemi.com/About-us/Contact-Us

    Regards,
    Sigurd Hellesvik

Related