Identical code to Peripheral HR Coded sample not working in my own project

Hi,

I've tested the peripheral_hr_coded sample before; using the VSCode extension, I created a new project and selected "nrf/sampls/bluetooth/periphral_hr_coded" as the template, and the code ran as expected.

Now, I want to modify the peripheral_hr_coded sample and use it in my own project. Using SDK 2.4.0, in VSCode, I created a new project starting from the zephyr/hello_world sample. I then pasted in the exact code from the peripheral_hr_coded sample (both in main.c and proj.conf). The project builds successfully, but runs with this error:

Fullscreen
1
2
3
W: opcode 0x2036 status 0x01
Failed to create advertiser set (err -5)
Advertising failed to create (err -5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The error is caused by th function bt_le_ext_adv_create().

This behavior has happened on both nRF7002DKs I've tested on.

I suspect I need to do some other configuration of my project to get the code to run? What am I missing?

Thanks,

Michael