!dASuPAbUCerhCYFqJs:matrix.org

nRF Rust

255 Members
Discussion medium for the nRF-rs organization on Github27 Servers

Load older messages


SenderMessageTime
19 Jun 2024
@wassasin:matrix.orgwassasin fuse117: you build SPM as part of your Zephyr project yourself 09:19:19
@wassasin:matrix.orgwassasinIf some NRF Rust crate packages SPM hex with the crate, it is just something a maintainer built and copied sometime09:20:29
@fuse117:matrix.orgfuse117i am trying to get nrf-modem working on the nrf9151. i have noticed in a few places such as code comments or rust docs, that the modem is inaccessible in secure mode. i have not seen official nordic documentation on this though. to run in non-secure mode, you need the spm. nordic lists the spm as deprecated. i have a pre-built version for the 9160 that works well. i gave a shot at trying to use it on the 9151, but it fails to program. i was kind of expecting this, but it was a cheap attempt. the replacement for the spm is the trusted firmware manager (tfm). the nrf sdk has a hello world tfm sample. i assume i can build that sample for the 9151 and just pull the tfm from it. does this sound reasonable? has anyone else built one for the 9151?14:24:48
@diondokter:matrix.orgdiondokter
In reply to @fuse117:matrix.org
i am trying to get nrf-modem working on the nrf9151. i have noticed in a few places such as code comments or rust docs, that the modem is inaccessible in secure mode. i have not seen official nordic documentation on this though. to run in non-secure mode, you need the spm. nordic lists the spm as deprecated. i have a pre-built version for the 9160 that works well. i gave a shot at trying to use it on the 9151, but it fails to program. i was kind of expecting this, but it was a cheap attempt. the replacement for the spm is the trusted firmware manager (tfm). the nrf sdk has a hello world tfm sample. i assume i can build that sample for the 9151 and just pull the tfm from it. does this sound reasonable? has anyone else built one for the 9151?
I've not used the 9151. But pulling the TFM sounds reasonable, pretty much the same as you'd do with the SPM
14:25:58
@diondokter:matrix.orgdiondokterIt's also possible to do from within Rust. But it's a giant PITA14:26:23
@fuse117:matrix.orgfuse117also, does anyone know what the 9120 is? nrxlib-sys is targeted to the 9160 as it pulls in libmodem.a for the 9160. in the nordic repo, there is the 9120. the 9120 is listed as the library to be used for the nrf91*1 series, so the 9131, 9161 and i assume the 9151. what is the 9120? some old chip whose name still persists? i assume the major difference between these libs is dect nr+ support14:30:17
@wassasin:matrix.orgwassasin fuse117: I believe the NRF9120 is the PN for the bare SoC that's inside the SoM 14:38:49
@wassasin:matrix.orgwassasinThere also exists a NRF923014:40:29
20 Jun 2024
@farooqkz:mozilla.orgFarooq [MR. Potato] changed their display name from Farooq [Potato] to Farooq [MR. Potato].14:18:13
21 Jun 2024
@dirbaio:matrix.orgdirbaiohas anyone used nrf91 libmodem raw sockets? 15:59:57
@dirbaio:matrix.orgdirbaio this tells me to nrf_socket(NRF_AF_PACKET, NRF_SOCK_RAW, 0) which I did and the socket opens fine 16:00:28
@dirbaio:matrix.orgdirbaio but trying to send() to it returns EINVAL 16:00:36
@dirbaio:matrix.orgdirbaiodunno if I have to sendto() instead... but sendto what? i'm writing a raw ip packet, which already has the dst addr and everything16:02:43
@dirbaio:matrix.orgdirbaiomaybe it is sendto indeed ... https://stackoverflow.com/questions/39682988/purpose-of-sendto-address-for-c-raw-socket16:04:35
@dirbaio:matrix.orgdirbaionope, EINVAL too16:06:52
@dirbaio:matrix.orgdirbaio😵‍💫16:06:59
@dirbaio:matrix.orgdirbaioaha there's an example. they're using send() https://github.com/nrfconnect/sdk-nrf/blob/d2577546fbb68711d516317929da008ccb36ad66/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c#L42316:13:18
@dirbaio:matrix.orgdirbaiothen wtf16:16:13
@dirbaio:matrix.orgdirbaiowhat am I doing wrong16:16:17
@dirbaio:matrix.orgdirbaioaha, it breaks if you create the socket too early.17:18:17
@dirbaio:matrix.orgdirbaio * aha, it breaks if you create the socket too early. you have to wait for pdn attach, then create the raw socket, then send()17:18:33
@dirbaio:matrix.orgdirbaioscreenshot-2024-06-21_19-16-09.png
Download screenshot-2024-06-21_19-16-09.png
17:18:48
@dirbaio:matrix.orgdirbaioit's working!!! :D17:18:50
@diondokter:matrix.orgdiondokterHaha cool!17:50:34
@dirbaio:matrix.orgdirbaiohttps://github.com/embassy-rs/embassy/pull/310518:29:00
@dirbaio:matrix.orgdirbaioI dunno whether to handle the AT stuff somewhat or leave it up to the user18:29:08
@dirbaio:matrix.orgdirbaiothere's tons of annoying boilerplate where you have to do AT commands to get the IP addr, DNS servers etc and then configure embassy-net with it...18:29:26
24 Jun 2024
@fuse117:matrix.orgfuse117 i finally have embassy running in the non-secure environment on the nrf9151. i am still trying to get nrf-modem running. the following line hangs for me unsafe { nrfxlib_sys::nrf_modem_init(PARAMS.get()) }.into_result()?;. i have noticed hangs when non-secure code tries to touch things that have been configured on the secure side. for example, initializing embassy hangs at (*pac::UARTE1::ptr()).enable.write(|w| w.enable().disabled()); for me because the TFM I am currently using uses that uarte1. diondokter are you aware of any configuration that needs to occur on the secure side for nrf-momdem to work? have you seen hangs like what I have described in the past working with the modem? 18:47:19
@diondokter:matrix.orgdiondokter
In reply to @fuse117:matrix.org
i finally have embassy running in the non-secure environment on the nrf9151. i am still trying to get nrf-modem running. the following line hangs for me unsafe { nrfxlib_sys::nrf_modem_init(PARAMS.get()) }.into_result()?;. i have noticed hangs when non-secure code tries to touch things that have been configured on the secure side. for example, initializing embassy hangs at (*pac::UARTE1::ptr()).enable.write(|w| w.enable().disabled()); for me because the TFM I am currently using uses that uarte1. diondokter are you aware of any configuration that needs to occur on the secure side for nrf-momdem to work? have you seen hangs like what I have described in the past working with the modem?
Hmmm not sure. Make sure that everything really is in non-secure mode. Other than that I don't know. I've written the wrapper, but what the library does inside is a black box
19:08:39
@dirbaio:matrix.orgdirbaioYou need a different libmodem.a19:57:23

Show newer messages


Back to Room ListRoom Version: 4