I closed the previous discussion by mistake: https://devzone.nordicsemi.com/f/nordic-q-a/83067/nrf9160-board-for-qr-code-project?ReplySortBy=CreatedDate&ReplySortOrder=Ascending
None can read the QR code directly because the QR Code is in a secure anti-tamper location with reliable staff. So we need to make secure the transmission.
How we can see what we are using? We didn't touch anything about the domain of the example so probably we are using the SPM.
These are the logs when we try to execute the uart in non secure domain:
2022-03-08T14:46:31.601Z DEBUG modem << * Booting Zephyr OS build v2.6.99-ncs1-1 * 2022-03-08T14:46:31.604Z DEBUG modem << Flash regionsDomainPermissions 2022-03-08T14:46:31.611Z DEBUG modem << 00 01 0x00000 0x10000 Securerwxl 2022-03-08T14:46:31.612Z DEBUG modem << 02 31 0x10000 0x100000 Non-Securerwxl 2022-03-08T14:46:31.614Z DEBUG modem << Non-secure callable region 0 placed in flash region 1 with size 32. 2022-03-08T14:46:31.616Z DEBUG modem << SRAM regionDomainPermissions 2022-03-08T14:46:31.617Z DEBUG modem << 00 07 0x00000 0x10000 Securerwxl 2022-03-08T14:46:31.619Z DEBUG modem << 08 31 0x10000 0x40000 Non-Securerwxl 2022-03-08T14:46:31.620Z DEBUG modem << PeripheralDomainStatus 2022-03-08T14:46:31.622Z DEBUG modem << 00 NRF_P0 Non-SecureOK 2022-03-08T14:46:31.624Z DEBUG modem << 01 NRF_CLOCK Non-SecureOK 2022-03-08T14:46:31.625Z DEBUG modem << 02 NRF_RTC0 Non-SecureOK 2022-03-08T14:46:31.626Z DEBUG modem << 03 NRF_RTC1 Non-SecureOK 2022-03-08T14:46:31.628Z DEBUG modem << 04 NRF_NVMC Non-SecureOK 2022-03-08T14:46:31.629Z DEBUG modem << 05 NRF_UARTE1 Non-SecureOK 2022-03-08T14:46:31.630Z DEBUG modem << 06 NRF_UARTE2 SecureSKIP 2022-03-08T14:46:31.631Z DEBUG modem << 07 NRF_TWIM2 Non-SecureOK 2022-03-08T14:46:31.633Z DEBUG modem << 08 NRF_SPIM3 Non-SecureOK 2022-03-08T14:46:31.634Z DEBUG modem << 09 NRF_TIMER0 Non-SecureOK 2022-03-08T14:46:31.635Z DEBUG modem << 10 NRF_TIMER1 Non-SecureOK 2022-03-08T14:46:31.636Z DEBUG modem << 11 NRF_TIMER2 Non-SecureOK 2022-03-08T14:46:31.637Z DEBUG modem << 12 NRF_SAADC Non-SecureOK 2022-03-08T14:46:31.639Z DEBUG modem << 13 NRF_PWM0 Non-SecureOK 2022-03-08T14:46:31.640Z DEBUG modem << 14 NRF_PWM1 Non-SecureOK 2022-03-08T14:46:31.641Z DEBUG modem << 15 NRF_PWM2 Non-SecureOK 2022-03-08T14:46:31.667Z DEBUG modem << 16 NRF_PWM3 Non-SecureOK 2022-03-08T14:46:31.670Z DEBUG modem << 17 NRF_WDT Non-SecureOK 2022-03-08T14:46:31.672Z DEBUG modem << 18 NRF_IPC Non-SecureOK 2022-03-08T14:46:31.674Z DEBUG modem << 19 NRF_VMC Non-SecureOK 2022-03-08T14:46:31.677Z DEBUG modem << 20 NRF_FPU Non-SecureOK 2022-03-08T14:46:31.681Z DEBUG modem << 21 NRF_EGU1 Non-SecureOK 2022-03-08T14:46:31.684Z DEBUG modem << 22 NRF_EGU2 Non-SecureOK 2022-03-08T14:46:31.686Z DEBUG modem << 23 NRF_DPPIC Non-SecureOK 2022-03-08T14:46:31.688Z DEBUG modem << 24 NRF_REGULATORS Non-SecureOK 2022-03-08T14:46:31.689Z DEBUG modem << 25 NRF_PDM Non-SecureOK 2022-03-08T14:46:31.692Z DEBUG modem << 26 NRF_I2S Non-SecureOK 2022-03-08T14:46:31.694Z DEBUG modem << 27 NRF_GPIOTE1 Non-SecureOK 2022-03-08T14:46:31.695Z DEBUG modem << SPM: NS image at 0x10000 2022-03-08T14:46:31.697Z DEBUG modem << SPM: NS MSP at 0x20018af8 2022-03-08T14:46:31.698Z DEBUG modem << SPM: NS reset vector at 0x16d81 2022-03-08T14:46:31.700Z DEBUG modem << SPM: prepare to jump to Non-Secure image. 2022-03-08T14:46:31.702Z DEBUG modem << * Booting Zephyr OS build v2.6.99-ncs1-1 *
We are reading from the UART using exactly the lpuart of the example online (https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.1/nrf/samples/peripheral/lpuart/README.html) and we think that the data from the QR code scanner are stored like a string.