The root cause is the resource sharing of the nRF9160 peripherals, I2C1 and UART1, which gets enabled by the CONFIG_NRF_MODEM_LIB_TRACE
. If the modem trace is required you may consider to use i2c3 in an overlay instead of i2c1.
Multiple Registrations at table_index 9 for irq 9
Thanks @AchimKraus,
For future reference what I ended up doing as a quick and dirty workaround was to change the I2C number in /ncs/v2.4.x/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_common.dts
from
&i2c1 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
pcf85063a@51 {
compatible = "nxp,pcf85063a";
reg = <0x51>;
};
lis2dh: lis2dh@18 {
compatible = "st,lis2dh";
reg = <0x18>;
irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
disconnect-sdo-sa0-pull-up;
};
};
to
&i2c2 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
pcf85063a@51 {
compatible = "nxp,pcf85063a";
reg = <0x51>;
};
lis2dh: lis2dh@18 {
compatible = "st,lis2dh";
reg = <0x18>;
irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
disconnect-sdo-sa0-pull-up;
};
};
as well as my overlay.
Yes, I was wrong.
I considered SPI2 was used for the flash, but it’s SPI3.
So I2C2 is the right one, if UART1 must be used for the modem trace.
Finally got around to playing with this. It’s a bit puzzling for sure. Working on a more elegant solution to avoid editing the common.dts file. Thanks @Yendor @AchimKraus for bringing this up.
- Edited
If I enable CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART=y looks like it resolves the issue. (Seems to happen even when not initializing I2C.) (See later posts) I disabled I2C1 just for good measure:
&i2c1 {
status="disabled";
};
In the case you need to use I2C you can remap it as @AchimKraus had suggested but simply do it in your overlay:
your app/boards/circuitdojo_feather_nrf9160_ns.overlay
/delete-node/ &i2c1;
&i2c1 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
pcf85063a@51 {
compatible = "nxp,pcf85063a";
reg = <0x51>;
};
lis2dh: lis2dh@18 {
compatible = "st,lis2dh";
reg = <0x18>;
irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
disconnect-sdo-sa0-pull-up;
};
};
If, for some reason, you need to change your bootloader image, you can add an overlay for that as well:
your app/child_image/mucboot/boards/circuitdojo_nrf9160_feather.overlay
(Note this is without the _ns
suffix)
Also some good notes here on the subject: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.html
- Edited
Also enabling &uart1 is not necessary according to the documentation. I did have to re-map to the TX/RX pins of the feather as well:
&uart1 {
current-speed = <1000000>;
pinctrl-0 = <&uart1_alt>;
pinctrl-1 = <&uart1_sleep_alt>;
pinctrl-names = "default", "sleep";
};
&pinctrl {
uart1_alt: uart1_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
<NRF_PSEL(UART_RX, 0, 23)>;
};
};
uart1_sleep_alt: uart1_sleep_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
<NRF_PSEL(UART_RX, 0, 23)>;
low-power-enable;
};
};
};
This is in the overlay.
My assumption is that the standard UART driver and the modem trace library are trying to bind/register to UART1 when enabled. When you leave it disabled, the modem trace will bind and configure it no matter what. Thus the “Multiple Registrations at table_index 9 for irq 9” error
Final overlay:
/ {
chosen {
nordic,modem-trace-uart = &uart1;
};
};
&i2c1 {
status = "disabled";
};
&uart1 {
current-speed = <1000000>;
pinctrl-0 = <&uart1_alt>;
pinctrl-1 = <&uart1_sleep_alt>;
pinctrl-names = "default", "sleep";
};
&pinctrl {
uart1_alt: uart1_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
<NRF_PSEL(UART_RX, 0, 23)>;
};
};
uart1_sleep_alt: uart1_sleep_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
<NRF_PSEL(UART_RX, 0, 23)>;
low-power-enable;
};
};
};
I was able to start a trace with this. The cellular monitor does not support non-Nordic boards. So I opened up a case with Nordic about it.
Did a quick video on this. The modem trace capture and use of Wireshark is awesome.
Hey @jaredwolff,
Firstly, thanks for all effort!
I’m trying to get a better understanding of how to implement a modem trace in my project that also uses the I2C bus. I think I’ve got it, but I just want to double-check with you.
Instead hacking the circuitdojo_feather_nrf9160_common.dts
it is better to change the project board overlay to something like:
/ {
chosen {
nordic,modem-trace-uart = &uart1;
};
};
&i2c1 {
status = "disabled";
};
&uart1 {
current-speed = <1000000>;
pinctrl-0 = <&uart1_alt>;
pinctrl-1 = <&uart1_sleep_alt>;
pinctrl-names = "default", "sleep";
};
&pinctrl {
uart1_alt: uart1_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
<NRF_PSEL(UART_RX, 0, 23)>;
};
};
uart1_sleep_alt: uart1_sleep_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
<NRF_PSEL(UART_RX, 0, 23)>;
low-power-enable;
};
};
};
&i2c2 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
pcf85063a@51 {
compatible = "nxp,pcf85063a";
reg = <0x51>;
};
lis2dh: lis2dh@18 {
compatible = "st,lis2dh";
reg = <0x18>;
irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
disconnect-sdo-sa0-pull-up;
};
};
Also, is it necessary to include the line /delete-node/ &i2c1;?
Apologies for the basic question. I’m still trying to wrap my head around the whole device tree concept. Any guidance would be super appreciated!
Yendor Instead hacking the circuitdojo_feather_nrf9160_common.dts it is better to change the project board overlay to something like:
Yes that looks great.
Yendor Also, is it necessary to include the line /delete-node/ &i2c1;?
Very much so. Otherwise the original i2c1 is still enabled and could cause a conflict when CONFIG_I2C=y
Yendor Apologies for the basic question. I’m still trying to wrap my head around the whole device tree concept. Any guidance would be super appreciated!
No worries. Hope that helps