Renesas EK-RA8D1 hard fault when flash the hex downloaded from edge impulse

Question/Issue:
Board Renesas EK-RA8D1 goes in an hard fault status (green, blue and red led start flashing) after flafh the .hex file

Project ID:
440970

Context/Use case:
After flashing the .hex file

Summary:
Board goes in hard fault after flashing the .hex file

Steps to Reproduce:
1.Download the project
2. Flash the board

Reproducibility:

  • [X] Always
  • [ ] Sometimes
  • [ ] Rarely

Environment:

  • Platform: Renesas EK-RA8D1
  • Build Environment Details: Powershell
  • OS Version: Windows 11
  • Project Version: 10

Additional Information:
I’m triyng to explore the edge impulse tool with the Renesas EK-RA8D1 board.
I’ve created the project, collected some data for the dataset and start to run some model.
I also used the EON optimization tool, using centroids setting. I’ve used FOMO model for the test. In the deployment stage, I’ve selected the Renesas EK-RA8D1 as a target and built using EON (But also tf lite seems give the same issue) and then flash the firmware. The board goes in a strange state where the screen is black and the leds near to user button stars flashing.

Any ideas? Thanks.

Hi @wreeee

Did you deployed using these settings?

If so, the problem is the RAM needed to run the model, it’s 1 Mb, which is not available - the board has more RAM, but part of it is already used.

The 3 LEDs blinking means a malloc failure, not an hard fault, see here firmware-renesas-ek-ra8d1-freertos/src/fault_handlers.c at 40313c9829677be5f2c15cec29a1e92111ca0444 · edgeimpulse/firmware-renesas-ek-ra8d1-freertos · GitHub .

I have tested your project using Eon Compiler and the Quantized option and it runs fine.
Can you try these settings too ?
Let me know if it works!

regards,
fv

Hi @ei_francesco. Thanks a lot for your answer.

Seems like that quantized model don’t go into malloc problem, but unoptimized one does. This is potentially a memory problem, but I don’t understand why, since the Evaluation Kit should have 64 M of external RAM:

Do you have idea? Thanks a lot.

Hi @wreeee

in the standard firmware, we don’t use the External RAM for the tensor arena, see firmware-renesas-ek-ra8d1-freertos/src/model/tflite-model/tflite_learn_33_compiled.cpp at 40313c9829677be5f2c15cec29a1e92111ca0444 · edgeimpulse/firmware-renesas-ek-ra8d1-freertos · GitHub , tensor_arena is a pointer an is allocated dynamically using the heap, which is located in the internal (and faster) RAM.

If for any reason you want to allocate the tensor arena in external RAM, you can follow the guide here: Running Nvidia TAO models on the Renesas RA8D1 | Edge Impulse Documentation .

The tutorial explains how to integrate a TAO model, which is not your case, but explain how to allocate the tensor arena in the external RAM: Running Nvidia TAO models on the Renesas RA8D1 | Edge Impulse Documentation

We are working on a way to ease the use of external memory in case of big model, but is not yet available.
If any further questions let me know.

regards,
fv