Nrf52832 devlopemnt board with LSM6DSL sensor

Hi @Arjan

we have nrf52832 development board and
we are following the steps which are described in the following link
https://github.com/edgeimpulse/firmware-nrf52840-5340-dk.

I have to build edge-impulse SDK to the nrf52832 development board using bash terminal through the command but I am getting errors.

west build -b nrf52dk_nrf52832 -p

but I have to build edge-impulse SDK to the nrf52832 development board using bash terminal through the command it is successfully built on this command.

west build -b nrf52840dk_nrf52840 -p

it is possible to build to nrf52832 board ?
please guide how it is posiible.

Hi, when I’m trying to build with

west build -b nrf52dk_nrf52832 -p

I get following error

/home/arjan/Documents/EdgeImpulse/Firmware/edgeimpulse/firmware-nordic-nrf5x/edge-impulse/ingestion-sdk-platform/NordicSemi-nrf52/ei_device_nordic_nrf52.cpp:78:2: error: #error "Unsupported build target was chosen!"
   78 | #error "Unsupported build target was chosen!"

That’s because we only support the nrf52840 and nrf5340 with this project. The reason for this is the small amount of RAM memory on the nrf52832.
You could try to adjust the code to allow build for the nrf52832, but depending on the model size this will work.

What kind of model are you trying to run?

Hello @Arjan,
previously we have used the example you have suggested and now we are trying to build using another example.
I am installing the standalone repo of example-standalone-inferencing-zephyr from the link.

After that, I’ve deployed the C++ library from the edge impulse project>deployment page.

We are using NRF52832 dev board, for this board when we build with the command:

west build -b nrf52dk_nrf52832 -p

the error logs are generated which is shown in the following link: Error log link

image.png

The above-given logs are for an Error generated project.

When we try with the same command: west build -b nrf52840dk_nrf52840 -p with another board name then it will build successfully without any errors as shown in the following link: output log link

image.png

The above-given logs are for a successfully built project.

NOTE: You will notice the significant difference between both logs will be at the end of it where it shows the generated O/P.

You’re not building the example-standalone-inferencing-zephyr project, but the firmware-nrf52840-5340-dk project.

Hello @Arjan,

As per the previous conversation, I have tried both examples separately but none of them is built successfully in this command.

west build -b nrf52dk_nrf52832 -p

@satyaveersingh, can you try to build this project: https://drive.google.com/file/d/1XCk0yH9VOslS6qf51T8LFZk0hIu3HdCz/view?usp=sharing

This works for me

Hello @Arjan,
please give the access.

You should now be able to download the zip

Hello @Arjan

we have done the Setup of the given Example.
I am trying to build the code but I am getting a path error.

west build -b nrf52dk_nrf52832

Traceback (most recent call last):
File “runpy.py”, line 193, in _run_module_as_main
File “runpy.py”, line 86, in run_code
File "C:\Users\Satyaveer\ncs\v1.7.0\toolchain\opt\bin\Scripts\west.exe_main
.py", line 7, in
File “C:\Users\Satyaveer\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py”, line 779, in main
app.run(argv or sys.argv[1:])
File “C:\Users\Satyaveer\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py”, line 106, in run
self.run_command(argv)
File “C:\Users\Satyaveer\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py”, line 338, in run_command
self.run_extension(args.command, argv)
File “C:\Users\Satyaveer\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py”, line 408, in run_extension
command.run(args, unknown, self.topdir, manifest=self.manifest)
File “C:\Users\Satyaveer\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\commands.py”, line 132, in run
self.do_run(args, unknown)
File “C:\Users\Satyaveer\ncs\v1.7.0\zephyr\scripts\west_commands\build.py”, line 183, in do_run
self._sanity_check()
File “C:\Users\Satyaveer\ncs\v1.7.0\zephyr\scripts\west_commands\build.py”, line 348, in _sanity_check
self._sanity_check_source_dir()
File “C:\Users\Satyaveer\ncs\v1.7.0\zephyr\scripts\west_commands\build.py”, line 337, in _sanity_check_source_dir
‘CMakeLists.txt’ in os.listdir(self.source_dir),
FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘C:\home\arjan\Documents\EdgeImpulse\Firmware\example-standalone-inferencing-zephyr’

please guid me further.

FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘C:\home\arjan\Documents\EdgeImpulse\Firmware\example-standalone-inferencing-zephyr’

It is referencing my file system. Are you using the -p flag?

if i am trying to this command so error is different.

west build -b nrf52dk_nrf52832 -p

– west build: making build dir C:\Users\Satyaveer\ncs\example-standalone-inferencing-zephyr\build pristine
CMake Error: Error processing file: /home/arjan/Documents/EdgeImpulse/Firmware/nordic/ncs/zephyr/cmake/pristine.cmake
FATAL ERROR: command exited with status 1: ‘C:\Users\Satyaveer\ncs\v1.7.0\toolchain\opt\bin\cmake.EXE’ -DBINARY_DIR=/home/arjan/Documents/EdgeImpulse/Firmware/example-standalone-inferencing-zephyr/build -DSOURCE_DIR=/home/arjan/Documents/EdgeImpulse/Firmware/example-standalone-inferencing-zephyr -P /home/arjan/Documents/EdgeImpulse/Firmware/nordic/ncs/zephyr/cmake/pristine.cmake

Zephyr is still using references to my machine.

Can remove the build folder and try again?

Hi @Arjan
we have successfully removed the build folder after that example is successfully built with the command.
after I have used this flash command (west flash) so I am getting the output log:

– west flash: rebuilding
ninja: no work to do.
– west flash: using runner nrfjprog
Using board 682760053
– runners.nrfjprog: Flashing file: C:\Users\Satyaveer\ncs\example-standalone-inferencing-zephyr\build\zephyr\zephyr.hex
Parsing hex file.
Erasing page at address 0x0.
Erasing page at address 0x1000.
Erasing page at address 0x2000.
Erasing page at address 0x3000.
Erasing page at address 0x4000.
Erasing page at address 0x5000.
Erasing page at address 0x6000.
Erasing page at address 0x7000.
Erasing page at address 0x8000.
Erasing page at address 0x9000.
Applying system reset.
Checking that the area to write is not protected.
Programing device.
Enabling pin reset.
Applying pin reset.
– runners.nrfjprog: Board with serial number 682760053 flashed successfully.

Hi @satyaveersingh,

That’s good news! Now you can use terminal connection to validate the output. Next step is to add sensors you want to use. As I mentioned we don’t fully support the nrf52832 so code for this you’ve to add yourself. But you can keep the project firmware-nrf52840-5340-dk as a reference.

Hi @Arjan
After flashing we have installed CLI tools for edge-impulse.

In Which Pins of the NRF52832 Development board need to be Connect to the Tx and Rx pins of UART to USB.beacuse of Nrf52832 Dev board all pins are multitasking.

my Hardware connection is nrf52832 development board with UART to USB connected to my computer.

it is done the setup for edge-impulse?

hello @Arjan

we can see the output in CLI-tools and I found we are not using external UART communication.
this is output log :
Edge Impulse impulse runner v1.13.16
[SER] Connecting to /dev/ttyACM1
[SER] Connected to /dev/ttyACM1
*** Booting Zephyr OS build v2.6.99-ncs1 ***
Edge Impulse standalone inferencing (Zephyr)
The size of your ‘features’ array is not correct. Expected 375 items, but had 6

another thing is there,
how can add another sensor please guide me further.

Hi @satyaveersingh,

You could follow this tutorial on running the impulse locally and how to fix the size of the features array.

Hi @Arjan

as per your suggestion, we have tried this SDK https://github.com/edgeimpulse/example-dataforwarder-zephyr but we are unable to build the project successfully.

so can you provide any reliable source for the lsm6dsl sensor’s SDK which is compatible to nrf52832 development board.

Hi @satyaveersingh,

You can start based on the standalone example that you sucessfully compiled.

From there you need to feed the accelerometer’s data into the features array, you can read more technical details in our documentation here (ie depending if you want features in Flash or RAM).

Also below is a code snippet for your accelerometer, using an STM32 board but the function should be similar on the Nordic:

Aurelien

1 Like

Hello @aurel
Greetings!!!

Thank you for your reply.

We do the same changes and the result is shown as below image,

Please verify the above result.

Also, help us to send data in the edge impulse console. Can you explain the data upload in which section of the edge impulse console?

Let us know if you have any questions.

we are following by this link.