STM32F7 + hardware neural network - Page 1
Forum section: electronics / general

author: ElektroSamo
author_rank: Newbie
timestamp: January 24, 2020, 08:54:27 am
content: Hi guys,I was wondering if there are people interested in artificial inteligence computed on embedded devices? Recently i have found a smart chip for accelerating neural networks produced by a Korean company called NM500http://general-vision.com/documentation/TM_NM500_Hardware_Manual.pdfand i am trying to play with it. I have found that the NM500 uses 16bit parallel bus and the manufacturer is using fpga as a interface to this bus. I find this quite limiting, because there is no easy way how to implement this chip without their fpga to my PCB designs.Thats why i have decided to programm a small C library form STM32 which uses DMA and standard GPIO to communicate with NM500 at full speed. Now i am creating a small developement kit (arduino footprint compatiblie), with STM32F7, three NM500, SD card, 128mb ram and camera interfaceI was wondering, since i havent found any posts about this chip in the forums if there are others interested in it? I am thinking of maybe going public with my kit and c library. And maybe try to sell it for reasonable price, but i dont know if there are others who will find a use for it.

author: andersm
author_rank: Super Contributor
timestamp: January 24, 2020, 11:18:03 am
content: Are you sure you can't use the MCU's external bus interface instead? The NM500 chip is clearly designed to work as a memory-mapped peripheral.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 27, 2020, 04:32:13 pm
content: That's interesting. I wonder what you can do with just 576 neurons though. I'd be curious to see applications and how fast this chip is.Haven't looked at the DS thoroughly, but you can probably do as andersm suggested and use it as MM with the appropriate interface on the MCU instead of more or less bit-banging (even with DMA), unless this is actually what you meant. You can use DMA as well anyway for a memory-mapped peripheral.

author: ElektroMichal
author_rank: Newbie
timestamp: January 28, 2020, 12:32:29 pm
content: Hi guys,The board contains 3x NM500 = 1 728 nurons.Could you please be more specific with memory-mapped peripheral?NM-bus looks like kind of modification of axi-bus, but even the manufacturer always uses FPGA and doesn't connect NM500 directly to MCU.I am using DMA and its working on a maximum allowed frequency 18 Mhz for multi-chipsWe are working on demo example MNIST Classifier. We also did some progress in face recognition

author: iMo
author_rank: Super Contributor
timestamp: January 28, 2020, 12:40:16 pm
content: STM32 uses FSMC hw interface - 8/16bit wide data + addresses + control signals.You may connect a standard memory to it easily.STM32 maps the external memory into its internal address range, in total max 4x 256MB.PS: while looking at NM500 DS you may wire the chips via the FSMC.Look at various FSMC modi, especially for read/write signals.All NM500 registers could be memory mapped and directly accessed from C code.

author: daqq
author_rank: Super Contributor
timestamp: January 28, 2020, 01:04:05 pm
content: QuoteThe FSMC peripheral in ST devices (and other similar systems exist in other architectures) allows you to directly access certain types of devices by means of the memory system and the peripheral handles the rest. Instead of, say, telling the SPI to send a byte by writing a command to a register, you simply write something along the lines of *0x12345678 = 0xFFAABBCC;. (Yes, this is simplified, but it's roughly what it does).This also allows you to talk to devices by means of DMA, enabling maximal communications speed without actually doing anything. Perfect for memories, feeding FPGAs etc.

author: iMo
author_rank: Super Contributor
timestamp: January 28, 2020, 01:10:50 pm
content: The speed of the FSMC is slower than the direct access of the internal ram, of course.The minimum is something like 6 clocks.You may set the speed parameters to accommodate slower devices with insertion of waitstates for RD and WR.Thus "full speed" access via FSMC cannnot be faster than say MCU_clock/6, provided your external device is fast enough.For example in F407 there are 4 address regions/blocks, each with some specifics, which need to be setup and enabled accordingly.Every region is 256MB large, and has a separate chip select.The external bus is 16bit, the FSMC reads 32bits so it needs several clocks.After setting up and enabling (!) the FSMC interface you may start read/write from/to those memory blocks via pointers in C for example.