This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NRF9160 Board for Qr Code Project

I need to create an IoT QR code reader.

I decide to use the NRF9160 board because it integrates a lot of components that I need to use (LTE, GPS, Bluetooth) so the only mandatory device to buy was the QR Code Reader.

This project aims to prepare a message to be sent to a blockchain, and this message is composed of the QrcodeData read, the location GPS, the time, etc.

It does not seem to be so difficult. -.-

I tried to connect the device with the NRF Cloud but the LTE connection is not available in Italy

I connected the four pins (VCC, GND, RX, TX of the reader to 5V, GND, 0.10, 0,11 of the board) of the Qr code reader (https://www.amazon.it/Waveshare-Barcode-Scanning-Directly-Computer/dp/B07P3GD3XV) to the board and I tried the UART connection with no results.

Then I tried the GPS connection following the sample of the guide with no results, always "Searching device".

I think that I really can't realize the project with this board, so I have three solutions, or I try to set a way to program the NRF9160 with the Arduino IDE where I feel more comfortable, or someone, probably God, helps me, or I change the board.

So, there is a way to program with the Arduino IDE?

This is all folks!

Merry Christmas and happy new year! :)

Parents
  • Okay now I solved a lot of issues:
    -the QR code reader is working
    -the GPS is working
    -I bought another sim that has nb-IoT coverage in my country.

    The next problems are:
    -I need to put in the same application 2 samples that I used (GPS and uart), there is a way?
    -Arm trust zone helps me to execute code in a secure environment. To do this I only need to switch the build from secure and no secure, right?
    -How I can build the samples one time in secure mode and one time in no secure mode? What should I change?
    -Is there a way to encrypt my data using the ECC (Elliptic-curve cryptography)?
    Thank you!!

  • Well, okay...
    I need to read a QR code (I do this with the uart) and for each QR code, I should associate the GPS information. So I should make these two applications work together in the same build.

    The problem is that the GPS works in the no-secure domain while uart works in the secure domain. I really don't know how to solve this problem.

    In each case, the aim of my project is to use the Arm trust zone technology and have at least the Qr code data isolated could be very cool.

    The goal that I want to achieve is that at the end I need to send this information encrypted to a server so maybe the ECC is not required. But about this how I can send all of this data to a specific server using the nb-IoT connection?

  • Gioele said:
    The problem is that the GPS works in the no-secure domain while uart works in the secure domain. I really don't know how to solve this problem.

    The GPS must be in the non-secure domain, because of limitation in the modem_lib. The UART can be in either domain, as long as the peripheral is configured to be in the same domain as the code. This configuration is done by the SPM or TF-M.

    Which UART are you using?

    Why do you want the QR code handling to be in the secure domain? What are you trying to protect, and against what?

    For now, it is probably easiest to have everything in the non-secure domain, until we have proper support for custom TF-M partitions in NCS.

    Gioele said:
    The goal that I want to achieve is that at the end I need to send this information encrypted to a server so maybe the ECC is not required. But about this how I can send all of this data to a specific server using the nb-IoT connection?

    What protocols are you planning to use to communicate with your server?

    The nRF9160 samples in NCS covers most of the supported protocols in NCS, and would be a good starting point to see how communication with a server can be done.

  • We are using UART1. Our component is a Qr Code scanner that is connected with two pins to the nrf9160DK (RX-->10; TX-->11). How can we change the configuration? When we are trying to work in the non-secure domain the application continues to restart like in a loop.

    Another problem is that when we receive data from the uart we are not able to put in a variable only the data read without the other character set by the buffer size. We haven't a clear view of the data received.

    We want to protect the information inside the QR Code. This information mustn't be read or changed by someone before they are sent to the server.

    We should use the IoT device to prepare an Ethereum transaction. We are following the documentation related to the WEB3 implementation in your IoT device that is https://platformio.org/lib/show/3895/web3-arduino/examples . but is related to Arduino.

Reply
  • We are using UART1. Our component is a Qr Code scanner that is connected with two pins to the nrf9160DK (RX-->10; TX-->11). How can we change the configuration? When we are trying to work in the non-secure domain the application continues to restart like in a loop.

    Another problem is that when we receive data from the uart we are not able to put in a variable only the data read without the other character set by the buffer size. We haven't a clear view of the data received.

    We want to protect the information inside the QR Code. This information mustn't be read or changed by someone before they are sent to the server.

    We should use the IoT device to prepare an Ethereum transaction. We are following the documentation related to the WEB3 implementation in your IoT device that is https://platformio.org/lib/show/3895/web3-arduino/examples . but is related to Arduino.

Children
  • Gioele said:
    We want to protect the information inside the QR Code. This information mustn't be read or changed by someone before they are sent to the server.

    Where does the QR code come from? Wouldn't someone else reading the QR code directly be a bigger threat than someone hacking your device, and reading the QR code that way?

    The data has to be transferred to the non-secure domain at some point, so that it can be given to the modem.

    Gioele said:
    We are using UART1. Our component is a Qr Code scanner that is connected with two pins to the nrf9160DK (RX-->10; TX-->11). How can we change the configuration? When we are trying to work in the non-secure domain the application continues to restart like in a loop.

    Are you using TF-M or the SPM in the secure domain?

    Do you have any logs showing what happens?

    Gioele said:
    Another problem is that when we receive data from the uart we are not able to put in a variable only the data read without the other character set by the buffer size. We haven't a clear view of the data received.

    How are you reading from the UART?

    How is the data from the QR scanner formatted?

  • 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.

Related