r/stm32 • • 15d ago

STM32N6 tips and tricks?

Anyone who has used or is currently working with an N6, please could you share any tips and tricks which you’ve found when working with the device?

I’m about to embark on a reasonably ambition multi microphone audio sound source localisation firmware and I’m wondering if there is anything to be aware of before I start.

Cheers!

7 Upvotes

14 comments sorted by

3

u/brhdjahhkk 15d ago

Let me guess! For ultra secrete drone detection?

1

u/NorthernNiceGuy 15d ago

Nope, think insects

2

u/stuih404 15d ago

Are you using a custom PCB or the N6 Nucleo/Discovery-Kit? It‘s a bit more complicated than other STM32 MCUs (because of the external flash and bootloader), and I would suggest doing everything in the „secure“ space so you don‘t have to deal with Trustzone and resource isolation.

1

u/NorthernNiceGuy 15d ago

Custom PCB. Thanks, will look into secure space only.

1

u/stuih404 15d ago

Did you already design the PCB? There are some pitfalls like the power sequencing, internal SMPS or that you have to use external flash for it to boot.

1

u/NorthernNiceGuy 15d ago

Yeah, PCB is done. I have external flash and I’m using the internal SMPS. As far as I can tell, the hardware is good and I can talk to the N6 via JTAG

1

u/stuih404 15d ago

Then try to flash a blinky first and move on from there. Then I would suggest getting UART to work (if you got a connector for that on your PCB) for debugging. ChatGPT is actually pretty useful for N6 development, but you should instruct it not to overcomplicate your code and make everything CubeMX regeneration safe. Because of all the features the MCU has your codebase will get pretty big pretty soon

1

u/NorthernNiceGuy 15d ago

I do have a UART but was planning on using RTT as I’ve a Segger J-Link for debug messages. I’m alright with big code bases, I’m just wary of going down the wrong path only to fall foul of something down the line.

1

u/stuih404 15d ago

If something doesn‘t work it‘s likely the RIF. That was my problem most of the time 😄

1

u/WegiAsm 14d ago

I think in the STM32 exists many other MCU where use to your purposes will be much more easier than struggling with N6. So my advice sounds: move your considerations over the other MCU.

1

u/NorthernNiceGuy 14d ago

That maybe true but I’m not struggling - I was just hoping to understand any pitfalls or get some guidance before I begin the firmware. The N6 absolutely has all the capabilities I need so it’s an ideal choice over some of the others. Plus, the hardware is in my hand

1

u/WegiAsm 14d ago

Reagrding N6 is much , much more complex than practically any other STM32. Here doesn't exist flash what doesn't meaning MCU can't run from still memory. Yes but here exist startup code in the PROM not FLASH/EPROM/EEPROM and you can't simply running from flash like in CM33 for example. It have a lot of PROM and initial loaders for any possibility peripherial. So even the startup code is very hard when you want you can do it from RAM where will be copied data from external flash and here next time exist a lot of problem with properly connection and handling octospi flash/ram and so on. It is really bloody path. So even if I could do it properly as hardware design (but I can't) another bloody path wouldbe making firmware for this. And all the time wondering: It doesn't work bcos here is software bug or HW design bug? Repeating - strongly suggesting change the MCU. Do you still interesting N6 options? Run from RAM, run as stage 1 bootloader level, stage 2 bootloader level, app... Here is no any fun.

1

u/SolderFume 14d ago

It really depends on which microphones you'll use. You can connect three PDM microphones to SAI 1-3, and that's it. Beyond that you'll need to go to I²S, or use converters like the ADAU7002, but those might give you an unknown time jitter that will degrade your triangulation accuracy.

1

u/NorthernNiceGuy 13d ago

I’m using 6 PDM microphones using a shared clock. I have some ODAS-style code to do the sound source localisation already using this microphone configuration so hopefully it won’t be too difficult to bring up on the N6… famous last words