cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-N657 board with AI and (FSBL+SNS)

prapk-engr
Associate II

Hi

I am using NUCLEO-N657X0-Q board, for the STM32N657 part, with the release STEdgeAI 2.0.
We are using STM32Cube ecosystem (IDE, CubeMX, Programmer) for the development. I have been using NPU Validation example without any issues.

The example there for the DK board, "\Projects\STM32N6570-DK\Applications\SNS\", which does not run for NUCLEO after a bit of changes for Nucleo. Gets stuck after the SystemIsolation_Config() in AppliNonSecure, with a Hard Fault.

SECURE_RegisterCallback(IAC_ERROR_CB_ID, (void *)SecureError_Callback);

(which is IACCVIOL = 1) ==> Though I have MPU is already enabled in the FSBL. 

 

Same time, after a bit of struggle with the CubeMX, Generated the code for Nucleo with X-Cube-AI 10.0 package. But this ended up with 1000's of errors in the build.

 

Another way, by trying from working SNS Application sample (of course with FSBL) from Nucleo Templates and then adding the AI related Middleware, Apps to NS App side, it goes as far as

/* End epoch block and advance to next one */
if (__LL_ATON_RT_GetWaitMask(nn_instance->exec_state.current_epoch_block) == 0x0)

inside LL_ATON_RT_RunEpochBlock() from

/* Execute first/next step */
ll_aton_rt_ret = LL_ATON_RT_RunEpochBlock(&NN_Instance_Default);

Where it gets a "<signal handler called>() at 0xfffffff9"

HFSR.FORCED = 1
HFSR_NS = 0

CFSR.MMFSR = 1 (which is IACCVIOL = 1) ==> Though I have MPU is already enabled in the FSBL. 
CFSR_NS = 0

Address region ranging in 0x340.... / 0x341.... previous instructions were accessible, like say for instructions 

ldr r3, [r3, #4]

 

Also I see the \STEdgeAI_2.0\Projects\STM32N6570-DK\Applications\SNS has code differences from the one generated from the CubeMX for DK board.
Is there a working sample for Nucleo, that has AI, .. something similar to the example DK - Projects\STM32N6570-DK\Applications\SNS as is in the STEdgeAI 2.0 release?

If not, Would you please give me working sample "SNS" sourcecode for DK bord in the CubeIDE?

Thank you.

5 REPLIES 5
prapk-engr
Associate II

Hello ST Team @stmicro 

Looking forward hear on this issue. 

Hello @prapk-engr ,

 

We are working on a SNS application example for the Nucleo.

I will update you when it becomes available.

 

Have a good day,

Julian


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
ShiLiba
Associate II

any updates, bro?

@ShiLiba,

In Core 4.0, the SNS app for DK can be used for nucleo.

We have a bug with the cubeIDE version, but if I am correct,  if you are using other toolchain it should work.

 

We are looking at the bug for cubeIDE, but it will not be fixed until next release (4.1)

 

Have a good day,

Julian


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
SlothGrill
ST Employee

Hello

Sorry the answer is ultra-late... 

 

The relevant differences between DK and Nucleo are as follows (for the project at stake):

  • Nucleo board has no external RAM, (i.e. if there are any reference to this RAM, should be removed, e.g. reference to BSP_XSPI_RAM_EnableMemoryMappedMode will most likely hang the program)
    • SystemIsolation_Config (located in the SECURE app, not on the NS... as suggested in the first post) also configures RISAF11, which is related to XSPI1=external ram on the DK, this config should be removed.
  • LEDs are used in this project, i.e. GPIO are used i.e. the GPIO mapping must be checked before trying to use the project as-is on the nucleo.
  • The project uses BSP for the DK, adapting it to nucleo means you should care about calls to BSP_ functions.

 

Retrying the project on the current versions (~4.0):

  • Some files were not compiled correctly on cubeIDE, leading to link errors (easily fixed by adding files to be compiled). Thanks for the feedback.
  • Following the README led to a functional run on my side (i.e. led blinking in cycle, on the DK)

 

Starting from a working S/NS example and adding AI in it works, but you need to understand what needs to be configured for the NPU not to trig secure faults/RIFSC faults. There is a part in the documentation that humblously tries to summarize things to know for TrustZone firmwares on N6, for AI.

 

Did you manage to do something on your side ? 

Did you find the issues ?