2014-11-12 02:55 AM
Hello
I'm wondering how to create a parallel interface on the STM32F4Discovery Board, if possible. As far as the application, I would like to connect the Discovery to BLACK FIN DSP (BF592) I was suggested to do by FSMC .. but I don't know how to do that. does any body can help me with basic code of understanding as well as with the link from which I can download the FSMC folder from the standard peripheral library.2014-12-09 04:22 AM
But what is the protocol/handshake? Does it need a bit stream, or a byte stream. I'm not so interested in what's going on inside the BF592, as much as I'm with you explaining how the interface is expected to function. Draw a diagram if it helps.
When you do a memcpy() in the M4 it's push a stream of bytes/word out the FSMC data pins, incrementing addresses, and strobing control signals. Look at say a NAND memory, there are no low order address bits, the part expects a block of data in a stream. You'd create a byte/word stream from you DSP's binary image, presumably coming out the linker, by using some simple file io (fopen/fread/fclose) and outputting a .C or .H file containing a variable definitions, and a list of bytes/words fprintf(fOut, ''0x%02X,'', byte[i]); Then you'd compile that into you STM32 project so you can deliver it to the DSP when it resets. Alternatively if you have an SD Card, or NAND memory, you could put the data directly in that, and copy it from there, independently of the STM32 code build.2014-12-10 05:22 AM
Hi
Thanks clive for the reply....I have converted the ldr file into array as per our suggestion.The protocol we are using is PPI which supports 16 bit at one time. Now what should I do to push it in the PPI port of DSP BF-5 I have attached one code the gpio pins configuration of pins I didn't change . I have to change according to our requirement (schematic design of pins used for the project) . Beside that I have not written anything in the main So that you can assist me what to write in the main so that it push to PPI port. ________________ Attachments : FSMC.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzwL&d=%2Fa%2F0X0000000bRC%2FfTRfN.ND59ecQIpyVoqCpYnMBg6ZG8D7Yjs_TlsMFYE&asPdf=false2014-12-10 06:14 AM
''I don't have any familiarity with the BF592, explain how the PPI works and what the signals are expected look like.''
We seem to be going in circles.2014-12-10 09:11 PM
The gpio pins of stm32f407 connected with the DSP-BF592(According to schematic)
given below +-------------------+--------------------+------------------+------------------++ FSMC_GPIO pins assignment of f407 +
+-------------------+--------------------+------------------+------------------+ | PD0 <-> FSMC_D2 - PPI2 |PE7 <-> FSMC_D4 - PPI4 | | PD1 <-> FSMC_D3 - PPI3 |PE8 <-> FSMC_D5 - PPI5 | | PD4 <-> FSMC_NOE- PPI_CLK | | PD5 <-> FSMC_NWE- PPI_CLK | | PD8 <-> FSMC_D13- PPI13 | | PD9 <-> FSMC_D14- PPI14 | | PD10 <-> FSMC_D15- PPI15 | PE9 <-> FSMC_D6 - PPI6 | | PD6 <-> FSMC_NWAIT- ADSP_PPI_FS1_INTR | PE10 <-> FSMC_D7 - PPI7 | | PD7 <-> FSMC_A17 - ADSP_PPI_FS2_INTR | PE11 <-> FSMC_D8 - PPI8 | | | PE12 <-> FSMC_D9 - PPI9 | | PD14 <-> FSMC_D0 - PPI0 | PE13 <-> FSMC_D10- PPI10 | | PD15 <-> FSMC_D1 - PPI1 | PE14 <-> FSMC_D11- PPI11 | | | PE15 <-> FSMC_D12- PPI12 |////////////////////////////////////////////////////////////////////////////////////////// PPI port expecting the 16 bit data at a time....In my f407 section I just have to push 16 bit data to the PPI port . I think FSMc pins will take care of it .that's what I wanted to know how to push the data ...#############################DSP_SECTION###############how the boot kernel works in DSP The boot kernel processes the boot stream block-by-block until it is instructed by a special command to terminate the procedure and jump to the application’s programmable start address, which traditionally is at 0xFFA0 0000 in on-chip L1 memory. This process is called “booting.�IF THE BOOTING OPTION IS MADE through PPI PORT In this boot mode, the kernel expects data to be received over the 16-bit PPI port. Data transfers are controlled with the incoming PPI_FS1signal. The processor uses the PPI_FS2signal to indicate when it is ready to receive data and how much data is expected ( these are done by the DSP guy)#############################DSP_SECTION###############
stm32f407 should provide the LDR data as per the PPI configuration stated
below• Receive mode with 1 external frame sync
• 16-bit bus width
• Data sampled on falling edge of clock
• Frame sync configured for falling edge asserted
• PPI_DELAY value of 0x0
I have also rewritten the code and attach it ,this time I have configured the gpio pins according to my requirements (schematic diagram) , pin connection between f407 anf bf592 shown above but I have not written anything in the main So that you can assist me what to write in the main so that it push to PPI port with the above configuration. if you need more information
Here is the hardware reference manual - there we learn about booting the DSP through the PPI parallel port, using the STM32F407 to boot the DSP.
http://www.analog.com/static/imported-files/processor_manuals/ADSP-BF59x_hwr_rev1.2.pdf
2014-12-11 03:27 AM
>In this boot mode, the kernel expects data to be
>received over the 16-bit PPI port. Data transfers are >controlled with the incoming PPI_FS1signal. The >processor uses the PPI_FS2signal to indicate when >it is ready to receive data and how much data is >expected Configure FSMC for 16-bit SRAM/PSRAM, connect all 16 data lines, connect FSMC_NWE of STM32 to your PPI_FS1 and your PPI_FS2 to FSMC_NWAIT of STM32 (you'll need to work out the polarity of these signals and invert them where needed, either in configuration of either party, if possible, or using a hardware invertor). In RM0090, read ''WAIT management in asynchronous accesses'' subchapter and configure FSMC accordingly. JW2014-12-11 02:00 PM
Shorting two output pins to PPI_CLK doesn't seem like a good plan.
So you can write to the 16-bit FSMC (PPI) by writing data to the memory address it uses. what is that? 0x64000000, in which case *((uint16_t *)0x64000000) = dataword; This will generate CS and WR pulses with the data on the lines. If you have the FS2 and NWAIT correctly configured as Jan suggests, perhaps the memcpy() will work. You could also presumably poll the FS2 state by reading the pin as a GPIO, between words. You could also drive the protocol completely via GPIO. It's not my job to read/interpret your DSP manual, I've asked you to diagram the protocol signals, not least because in doing so you'll have to understand the nature of the signalling, and you might see numerous ways you can generate those sequences either manually, or assisted by hardware within the STM32. If you have clarity in what it is you need to do, and can illustrate that, it will assuage doubt. Right now it sounds like a ''centronics printer'' type protocol, where you wait on a BUSY signal (FS2), you put data on the bus, and then strobe the receiver latch via (FS1 and/or CLK)2014-12-12 02:37 AM
Yes I think it has to wait on a BUSY signal (FS2), you put data on the bus, and then strobe the receiver latch via (FS1 and/or CLK) (we have to do in this way)
But How to do this ....I dont have any idea ....could you please guide me.....I have attached my incomplete code...how to start in main? I have configure the pins according to the GPIO pins configuration post in the previous post Please help ________________ Attachments : FSMC.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzwG&d=%2Fa%2F0X0000000bRD%2FTZBB9ymMDRQDTD8bCrOgyCfE4hfvwuNrfMugJoV45Ns&asPdf=false2014-12-14 09:08 PM
Yes we should code in this way
''BUSY signal (FS2), you put data on the bus, and then strobe the receiver latch via (FS1 and/or CLK) (we have to do in this way)'' The main motive is to boot the BF-592 though stm32f407 But How to do this ....I dont have any idea ....could you please guide me.....I have attached my incomplete code...how to start in main? I have configure the pins according to the GPIO pins configuration post in the previous post Please help.... ________________ Attachments : FSMC.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzw6&d=%2Fa%2F0X0000000bRF%2F32OtNLXlfz8W4_VPL4q6xHbFcD7H8zt6WrRcrp2Bk68&asPdf=false2014-12-14 11:22 PM
could you please guide me
I can only guide you if you listen to what I ask of you. Step#1 Create a timing diagram of the signals the DSP expects, this will include pulse sequences and durations, and periodicity expected of those signals. Step#2 Code a word output loop for all the words in the firmware image, spin waiting on the busy signal, and when ready output the word to the bus as previously described. Repeat the process for each word. I understand the goal, multiple copies of the current source is not helping me. In order to cross the river we must go along the bank to the bridge, not keep pointing at the far shore in hopes that pointing at it will somehow get us there.2014-12-15 05:41 AM
I am not aware of timing diagram of the signals the DSP expects. This communication is in asynchronous mode.
In DSP side the set of rule which i kw is Data transfers are controlled with the incoming PPI_FS1signal. The processor uses the PPI_FS2signal to indicate when it is ready to receive data and how much data is expected. So i need to follow this simple protocol....I think it works . I have made the pin configuration according to jan. we have to wait for the BUSY signal (FS2), put data on the bus, and then strobe the receiver latch via (FS1 and/or CLK). according to me this is the simple way of doing it . One more thing to clear is When the F407 wants to write a packet, the 592 PPI port clock is set to clock in data on the rising edge of FSMC_NWE. When the F407 wants to read data, the 592 PPI port is set to clock OUT data on the FALLING edge of FSMC_NOE. The only doubt is how to configure the FSMC to make it work in the above mentioned way or I have to do it manually. I have attached my updated code ________________ Attachments : FSMC.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hztc&d=%2Fa%2F0X0000000bRE%2FlcJPOqzpQIfAAr0nIIzmMbPKedc1BlfDEHoY6isTjnA&asPdf=false