cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6 CSI Interface with Raspberry Pi Camera Module 2 NoIR

Linas L
Senior II

Hello,

Is there any chance ST could provide examples or guidance on interfacing a CSI (MIPI) camera with Raspberry Pi Camera Module 2 NoIR cameras?

From my initial research, it seems the CSI connector uses the same pin layout as Raspberry Pi cameras. However, available examples are quite limited, making it challenging to implement this on my own — especially compared to the simplicity of working with DCMI.

Any documentation, sample code, or community insights would be greatly appreciated!

Thank you.

LinasL_0-1739781451488.png

LinasL_1-1739781596267.png

With best regards,
Linas

16 REPLIES 16
EmbeddedChris
Associate II

Sorry to say but I was unable to debug anything on EWARM despite updating to the latest version of the IDE and installing the N6 patches. Not even the ST examples would work because it didn't like the external loader. The examples seemed to run okay in CubeIDE though.  

You can connect to target when it's already running from the project menu. That should work. If you run an FSBL and application, you can also debug without downloading code, so you should flash your application manually first. Then select the FSBL sub-project and set your options like in my screenshots. This should download the FSBL to RAM and execute it from there and load the debug data for your application, but not load the image to your board, so you should be able to cross the boundary with debugging intact.

You may or may not need the .mac file, if you don't have it, here's the content of mine:

/* Called once after the target application is downloaded. */
execUserSetup()
{

    /* Re-load image partially erased by IAR reset */
    __loadImage("$EXE_DIR$\\$TARGET_FNAME$", 0, 0);


    __restoreSoftwareBreakpoints();

     
     #PC = __readMemory32(0x34180404, "Memory");
     
     #SP = 0x341FFD00;
  
}

Hello,

I was able to blink the LED using the N6 and CubeProgrammer, but debugging is very strange so far.
By changing settings, jumpers, and resetting, I managed to make it work once; however, it never stayed at main. It was just running, and when I stopped execution it jumped to the correct location in the C code.

What am I missing? Or should I just not use EWARM?

All settings matched yours and the project example (it failed to compile in the original directory due to MAX_PATH issues):
NUCLEO-N657X0-Q\Examples_LL\GPIO\GPIO_InfiniteLedToggling_Init

If everything is done correctly, should a debugging session feel like any other flash-based microcontroller (halt at main), or will you always attach to running code with the debugger?

(Mine had “Reset by hardware” enabled by default.)



mathiasmarkussen
ST Employee

Did you follow the guide in the link I posted earlier?

In any case, the problem with trying to break at main() is that the symbols for the application are not loaded when you start the debugging session from the FSBL. I'm not sure when that happens when using the guide I posted earlier, but you should be able to break in the debugger just before entering the application (i think he sets it up to do that in the guide), and then add your break point in main. Otherwise, you can step into the application, an then set your breakpoint at that point.

You can also try downloading TouchGFX and looking at the board setup for N6 there - it incorporates some of the same concepts as described in the guide, but implemented differently. You should be able to remove TouchGFX from the project using CubeMX (and removing some references in the .extsettings file) if you're not interested in using that.

Saeid
Associate II

Hi @Linas L  Can you please help me understand how you connected Raspberry Pi Camera Module 2 NoIR to STM32N6 eval board, as Raspberry Pi Camera Module 2 NoIR has 15pin but STM32N6 board has 22pin

 

 

Saeid_0-1759460869640.png

Saeid_1-1759460869836.png

 

Simple.

Pi5 has special cable for this. You can buy it in mouser/digikey. Since just like pi zero, pi5 use same 0.5mm pitch connector on pcb

Wow nice! Thanks Linas for sharing this.

can you please share Digiky/Mouser link that I can buy ? 
In this cable, the VCC from pin# 15  has been mapped to pin#22 ,right?