jaredwolff Are you using a Joulescope JS110 or JS220 analyzer?
Wouldn’t the Nordic Power Profiler Kit II II do similar measurements? Thanks.
nRF9160 Feather - Suggestions for next version
JS110
PPK2 doesn’t sample as fast.
- Edited
Maybe someone can jump in.
I’m currently struggling to build apps for the new nRF9161 feather.
As “usual”
it builds on Jared’s machine
it fails on my machine.
if someone could spend an hour or so, it would be great, if you can check that on your machine .-).
See other ticket “builds for nRF9161 with mcuboot” for some more details
Some first experience:
Using west flash --runner pyocd
sometimes reports
W nRF9160_xxAA APPROTECT enabled: will try to unlock via mass erase [target_nRF91]
not sure, what’s causing that. The “mass erase” will erase the “settings”.
After flashing it seems to require an hw reset by the button, otherwise the modem seems to be inaccessible.
Beside of that the nRF9161 feather works very nice!
Using the LEDs isn’t to complicated and in addition to the nRF9160 feather it’s now possible to read the charger status.
I’m not sure, why Nordic decided to not implement the zephyr “charger API”, and to use the “npm1300 sensor” API requires some datasheet reading. But all in all, my client was fast ported and we will see, how long that new feather will run on battery ;-).
Changes required:
The
button0: button_0 {
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
label = "Switch 1";
zephyr,code = <INPUT_KEY_0>;
};
seems to use the wrong polarity, I changed it to GPIO_ACTIVE_HIGH
- Edited
And CONFIG_BOARD
is undefined. Not sure, why.
I’ve added
if BOARD_CIRCUITDOJO_FEATHER_NRF9161_PMIC_STARTUP
config BOARD
default "circuitdojo_feather_nrf9161"
endif
as temporary work-around to Kconfig.defconfig.
About the power rails:
Is VDD connected to the battery or to the NPM1300?
Or in other words, does “AT%XVBAT” report the battery voltage or the output voltage of the NPM1300?
- Edited
About the CONFIG_BOARD
:
in “zephyr/boards/Kconfig”
choice
prompt "Board Selection"
source "$(BOARD_DIR)/Kconfig.board"
endchoice
That makes a choice out of `zephyr/boards/arm/circuitdojo_feather_nrf9161/Kconfig.board’
if SOC_NRF9161_LACA
config BOARD_CIRCUITDOJO_FEATHER_NRF9161
bool "Circuit Dojo nRF9161 Feather"
config BOARD_CIRCUITDOJO_FEATHER_NRF9161_NS
bool "Circuit Dojo nRF9161 Feather non-secure"
config BOARD_CIRCUITDOJO_FEATHER_NRF9161_PMIC_STARTUP
bool "Allows for executing startup code for PMIC."
endif # SOC_NRF9161_LACA
and so `zephyr/boards/arm/circuitdojo_feather_nrf9161/circuitdojo_feather_nrf9161_ns_defconfig’
# Startup code
CONFIG_BOARD_CIRCUITDOJO_FEATHER_NRF9161_PMIC_STARTUP=y
deselects BOARD_CIRCUITDOJO_FEATHER_NRF9161_NS
. In consequence,
if BOARD_CIRCUITDOJO_FEATHER_NRF9161 || BOARD_CIRCUITDOJO_FEATHER_NRF9161_NS
config BOARD
default "circuitdojo_feather_nrf9161"
is not longer applied.
AchimKraus not sure, what’s causing that. The “mass erase” will erase the “settings”.
After flashing it seems to require an hw reset by the button, otherwise the modem seems to be inaccessible.
Not quite sure. It may be that pyocd
is enabling the write protect. I haven’t had enough time to look at it.
AchimKraus Using the LEDs isn’t to complicated and in addition to the nRF9160 feather it’s now possible to read the charger status.
I’m not sure, why Nordic decided to not implement the zephyr “charger API”, and to use the “npm1300 sensor” API requires some datasheet reading. But all in all, my client was fast ported and we will see, how long that new feather will run on battery ;-).
Glad it’s working.
AchimKraus seems to use the wrong polarity, I changed it to GPIO_ACTIVE_HIGH
Yup you’re correct. Changed.
AchimKraus About the power rails:
Is VDD connected to the battery or to the NPM1300?
Or in other words, does “AT%XVBAT” report the battery voltage or the output voltage of the NPM1300?
VDD is hooked to VSYS which is whatever is providing the power (battery or USB). The VBAT command will measure the battery unless you have USB plugged in (then it will read 5V)
- Edited
You need to be building with –sysbuild if you’re using 2.7.x:
west build -b circuitdojo_feather_nrf9161/nrf9161/ns -p -d build/circuitdojo_feather_nrf9161 --sysbuild
That should generate all the necessary board definitions:
CONFIG_BOARD_REVISION="1"
CONFIG_BOARD_TARGET="circuitdojo_feather_nrf9161@1/nrf9161/ns"
# CONFIG_NET_DRIVERS is not set
CONFIG_BOARD_CIRCUITDOJO_FEATHER_NRF9161=y
CONFIG_BOARD_CIRCUITDOJO_FEATHER_NRF9161_NRF9161_NS=y
CONFIG_BOARD_QUALIFIERS="nrf9161/ns"
CONFIG_BOARD_CIRCUITDOJO_FEATHER_NRF9161_PMIC_STARTUP=y
That was in nfed/samples/active_sleep/build/circuitdojo_feather_nrf9161/active_sleep/zephyr/.config
I’m still on v2.6.1.
One additional irritating issue is, that it fails to build, if CONFIG_TFM_LOG_LEVEL_SILENCE=n
is used. That works at least for nRF9161-DK.
After flashing it seems to require an hw reset by the button, otherwise the modem seems to be inaccessible.
It gets sometimes delayed for 50s. For now I guess, that’s the “secure random”. That will require some more investigation.
- Edited
AchimKraus and so `zephyr/boards/arm/circuitdojo_feather_nrf9161/
deselects BOARD_CIRCUITDOJO_FEATHER_NRF9161_NS. In consequence,
Ahh OK.
I made some tweaks. If you want the PMIC init code you can add
CONFIG_CIRCUITDOJO_FEATHER_NRF9161_PMIC_STARTUP=y
To your .conf file in the application. It’s only necessary for samples that use lots of current (i.e. anything that uses the modem). Otherwise it will remain off for everything.
I pushed the changes to your branch and 2.7.x
AchimKraus It gets sometimes delayed for 50s. For now I guess, that’s the “secure random”. That will require some more investigation.
50s! Wow it’s not taking that long here. That’s definitely an issue.
Adding documentation as we go:
https://docs.circuitdojo.com/nrf91x1-feather/building-and-programming.html
What is the function of the button “BS”?
AchimKraus What is the function of the button “BS”?
It’s not what you think!
It’s the boot select button for the RP2040. Hold it while plugging in and it will put the RP2040 into bootloader mode.
About the updated board-support:
I would prefer to add a default, e.g.
config CIRCUITDOJO_FEATHER_NRF9161_PMIC_STARTUP
bool "Allows for executing startup code for PMIC."
default y if BOARD_CIRCUITDOJO_FEATHER_NRF9161_NS
To be frank, “It’s only necessary for samples that use lots of current (i.e. anything that uses the modem). Otherwise it will remain off for everything.” will not apply to often. If I don’t need the modem, there are much cheaper and more powerful feathers. Therefore I guess it’s usually on, and only in some rare cases it may be off.
@AchimKraus understood! I was thinking in comparison with the non-modem samples. But yep, it doesn’t hurt to have it on at all times. My biggest hurdle it making sure that it’s only loaded in the app image and nothing else since it also includes a 2 second delay for device recovery purposes.
circuitdojo_feather_nrf9161_ns_defconfig.
# Fixes for I2C
CONFIG_TFM_SECURE_UART=n
with that I get:
modules/tee/tf-m/trusted-firmware-m/platform/ext/common/uart_stdout.c:104: undefined reference to `Driver_USART1'
Memory region Used Size Region Size %age Used
FLASH: 47932 B 48640 B 98.54%
RAM: 14244 B 32 KB 43.47%
collect2: error: ld returned 1 exit status
I guess, that is considered for i2c1 (which was used for the nRF9160 but not for nRF9161, there it’s i2c2) and the default TF-M UART1. I use
CONFIG_TFM_SECURE_UART_SHARE_INSTANCE=y
CONFIG_TFM_SECURE_UART0=y
that works as intended, if I remove
CONFIG_TFM_SECURE_UART=n
So, do you think, this is required in general? What is the benefit of that?
If it should be kept, I will just enable it again on my own “risk” in the prf.conf.