Jump to content

STM32F4 Discovery


niklasni1

Recommended Posts

I noticed that a port to the STM32F4 Discovery has shown up in the MIOS sources. What is the status of the port? Is a new Core board planned?

 

The STM32F4 parts have a few features that the LPC1769 doesn't, mainly a proper SD card controller that can use 1 or 4 bit modes instead of SPI, should be a lot faster; and an external memory controller for SRAM or additional Flash. Unfortunately the 100 pin part on the Discovery board doesn't expose all the pins needed to properly interface with external memories, but for synth/sampler-types of instruments the prospects of a MIOS with access to megabytes of fast storage is quite exciting I think :smile:

 

The Discovery board does have the nice feature of an integrated audio quality stereo DAC, which I'd hope to see supported.

Edited by niklasni1
Link to comment
Share on other sites

  • Replies 109
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I noticed that a port to the STM32F4 Discovery has shown up in the MIOS sources. What is the status of the port? Is a new Core board planned?

Well spotted!

It seems TK has been quite busy with this in the first half of june, according to the repo logs.

He's posted benchmarks that show at least a pro-rata increase in performance (for all except USB midi, interestingly).

The tests are at 168MHz. I guess we'll hear more about all this in due course.

Link to comment
Share on other sites

Finally somebody discovered the STM32F4 Discovery adaptions...  :wink:

 

Yes, I used this evaluation board to check if it's worth to spend some more time for a proper MBHP integration.

Please don't expect a public release this year, because in order to do it right many hardware related topics have to be considered; especially some hardware conflicts have to be solved (more about this topic below).

Currently I don't have so much time to continue with this due to various business trips around the world. I will probably continue in September.

 

On the other hand, hackers with some background knowledge would already be able to use this board for own experiments with MIOS32.

For a kickstart: here the precompiled bootloader 

<removed>

New page: http://www.ucapps.de/mbhp_core_stm32f4.html

 

What is working so far:

- system init, timers, interrupts, FreeRTOS, etc.

- accessing the onboard LEDs

- USB MIDI and UART based MIDI

- code upload via MIOS Studio

- I2S (@Niklasni: yes, even the onboard DAC is running, I tested it with apps/tutorials/024_i2s_synth)

- SD Card access (but with common SPI)

- SRIO

- IIC (accessing the MBHP_IIC_MIDI module)

 

What is not implemented yet:

- ADC (because I haven't started with the adaption yet)

- LCD (low prio, have to find some free pins which are not used for other purposes)

- SW based SPI for J19 (have to find free pins, or maybe I will use a HW SPI for this..)

 

and that's all ;-)

 

Applications which are already running without issues (aside from the missing ADC, LCD and J19 support):

- MIDIbox SEQ V4

- MIDIbox NG V1

- MIDIO128 V3

- MIDIbox CV V2

 

so - no real show stopper.

 

But the hardware connectivity will be a challenge, because unfortunately some important pins - especially for UARTs - are allocated by onboard resources.

E.g. although the chip contains 6 UARTs, many of them can't be used bidirectionally due to these conflicts.

I don't understand, why ST doesn't integrate some more internal multiplexers for alternative connections...

In other words: the usage of this board will have some limitations.

 

The main advantage that I see: not only higher speed, but especially much more RAM!

192k instead of 64k (LPC1769, STM32F1) makes a big difference.

I'm especially happy that MIOS32 applications like MBNG and MBSEQ can be easily upgraded with an inexpensive core module replacement in future!

 

The onboard DAC and Cortex-M4 based DSP capabilities are also great for synths or Fx units of course, but I'm unsure if I will go into this direction by myself.

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Great news, TK. I've got one of these boards already, wilil be trying this out.



I think the reason for the missing functionality is that all the STM32F4 have the same peripherals, but they come in packages from 64 up to 176 pins... Like said, the static memory controller is present on the 100 pin version on the Discovery board, but it exposes less than half of the address pins (and not a sequential section of them, either -- pin 0 and 12-22 or something) so it's next to useless. I'm guessing they designed the largest one first and took stuff out. Oh well. Still a lot of stuff for the price.

Link to comment
Share on other sites

Hey.

 

I tested the synth tutorial and it works perfect out of the box. So already we have a nice prototyping tool for making MIOS synths :)

 

I'm having trouble attaching an SD card (1GB, Fat16 formatted), but I'm not sure exactly where the fault is. I'm connecting the card reader's DI to PA7, CLK to PA5, DO to PA6 and it's not seeing the card. The reader also has a ^CS pin, but I'm not sure where that should go. I've tried pulling it both high and low, and also swapping the DI/DO pins just to check. This is with seqv4 app, latest SVN revision.

 

[133411.656] sdcard

[133411.658] SD Card Informations
[133411.658] ====================
[133411.658] ERROR: Reading CID failed with status -256!
[133411.658] ERROR: Reading CSD failed with status -256!
[133411.658] 
[133411.658] Reading Root Directory
[133411.658] ======================
[133411.658] SD Card: not connected
[133411.659] Failed to open root directory - error status: 12
Link to comment
Share on other sites

Right. Having gotten my two brain cells to cooperate :) I looked at the SD card module schematic and figured it out. For anyone wanting to try it, this is the pin out for the Discovery board:

 

PA4 - CS

PA5 - SCLK

PA6 - MISO

PA7 - MOSI

Link to comment
Share on other sites

  • 2 weeks later...

Complete noob with MIOS, I am trying to use an STM32F4 discovery board to create a MIDI USB 3 manuals console.

I used the precompiled bootloader from the post above and flashed it using CoFlash (using Windows and did not find any other software to flash the binary).

I am powering the board from PC using the STM link USB interface and then connect the board to the PC using the micro USB connector on the board.

I get  a USB device not recognized message and MIO studio does not see the board.

I am probably missing something obvious but did not figured out yet!!!

Any help welcome.

JLD

Link to comment
Share on other sites

Complete noob with MIOS, I am trying to use an STM32F4 discovery board to create a MIDI USB 3 manuals console.

Not sure what you are trying to achieve, but an LPC17 based core will give you guaranteed results and much more possibilities, especially for a MIOS beginner.

Link to comment
Share on other sites

LPC17 is probably an easier solution but I have an STM32F4 board and would like to do something with it.

Because there are more than enough I/O on the board, I would like to avoid using an additional multiplexer and perform the 3 Keyboards decoding using 40 of the GPIO (it requires 28 I/O without velocity and 40 I/O with).

The code to scan multiple FATAR keyboards is already working and the initial reason to work with MIOS was to benefit from USB MIDI support.

Looking at all the possibilities of MIOS, a good solution might be to turn the code for the multiple FATAR keyboards into a MIOS application if I can manage to access the 40 IO I need.

 

Looking at TK post, a lot seems to be already working and I just wonder how to get the bootloader on the board and have it recognized by MIOS studio.

Any help in that sense would be appreciated.

 

JL

Link to comment
Share on other sites

Reading the LPC tuto, I saw that :

"Background: the 3.3V line between LPC-Link and target powers the core if an USB cable is connected to the LPC-Link module.

But usually we want to power the core from the USB socket of the MBHP_CORE_LPC17 module. As long as the 3.3V connection is available, the LPC-Link will be powered as well, and it forces the LPC1769 chip into reset as long as no debugger connection has been opened by the LPCXpresso IDE."

 

Does it mean that on the STM32F4 disco board, after the bootloader is flashed, STLINK should be disconnected as well to allow the bootloader to boot correctly?

Link to comment
Share on other sites

hello,

 

I was able to flash the bootloader with Coocox on my STM32F4, but I am having problems with mios studio.

 

I am able to get MIOS32 MIDI : IN and OUT. But i get this:

 

No response from MIOS8 or MIOS32 core!  next to device ID. I was wondering if you stumbled upon this problem, and how you fixed it.

 

Thanks.

 

 

post-18955-0-05976700-1374153197_thumb.j

Edited by nihle
Link to comment
Share on other sites

LPC17 is probably an easier solution but I have an STM32F4 board and would like to do something with it.

Because there are more than enough I/O on the board, I would like to avoid using an additional multiplexer and perform the 3 Keyboards decoding using 40 of the GPIO (it requires 28 I/O without velocity and 40 I/O with).

The code to scan multiple FATAR keyboards is already working and the initial reason to work with MIOS was to benefit from USB MIDI support.

Looking at all the possibilities of MIOS, a good solution might be to turn the code for the multiple FATAR keyboards into a MIOS application if I can manage to access the 40 IO I need.

 

Looking at TK post, a lot seems to be already working and I just wonder how to get the bootloader on the board and have it recognized by MIOS studio.

Any help in that sense would be appreciated.

 

JL

I understand now.

The F4 would make a very cost effective and high performance MIDI keyboard decoder.

Just so long as you are aware there is already developed solutions out there now. I use a MIDIbox KB with 2x61 Fatar Keybeds, works beautifully. On the other hand it seems to me the cost of an LPC17 expresso, Core, and SRIO all up probably costs me >$100, which in some ways seems a little expensive for what is actually required: a microcontroller and a few connectors.  

Link to comment
Share on other sites

Beside flashing the project.bin provided by TK, what else should be done???

Same problem as Nhile:

MIOS studio sees MIOS32 IN/OUT but does not connect.

What is also wierd is that after bootloader is flashed, it is necessary to set BOOT0 to VDD for ST-LINK to be recognized by the PC???

 

niklasni1, would you mind describing the step you went through to get it running?
Link to comment
Share on other sites

I just flashed the .bin that TK posted using the st-flash utility from the stlink package, and then uploaded the firmware with MIOS studio as normal. This is all on Linux. I don't use any IDEs so I don't know how it's done, but with st-flash it's just

 

$ st-flash write project.bin 0x08000000

 

(where 0x08000000 is the memory offset where the internal flash starts, as per the STM32F4 datasheet)

 

After that, I reboot the board and it shows up as a MIDI device (make sure you connect both USB ports to your computer).

Edited by niklasni1
Link to comment
Share on other sites

Thanks for your support

 

I used the STM32 ST-LINK utility which provides a GUI but does the same as the line command.

post-5179-0-81804500-1374297147_thumb.jp

 

This is weird since everything else seems to work.

I have ordered a new board just in case it is a HW problem.

Edited by jld
Link to comment
Share on other sites

You are spreading your questions to too many (unrelated) postings - I'm sure that this will confuse other users in future.

 

USB MIDI is currently only tested under MacOS, where it's working stable. I haven't checked this under Windows yet, this could be the reason why it doesn't work (the new USB driver provided by ST is very different compared to the one used for STM32F1xx)

 

One reason for the failure under Windows could be, that you've to re-plugin the USB MIDI cable, and thereafter restart MIOS Studio, after the bootloader has been installed.

 

Btw.: some words to the SD Card connections: it could be, that I will change some pinnings soon, so that the internal (ROM based) bootloader can be used to fetch the flash from a SD Card. I especially like this possibility, because it's platform independent. :smile:

 

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 1 month later...

TK - I seem to have successfully compiled with support for hardware floating point. In include/makefile/common.mk, I changed the STM32F4xx CFLAGS (line 59) to:

 

 

 

CFLAGS += -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -mfloat-abi=hard -mlittle-endian -ffunction-sections -fdata-sections -fomit-frame-pointer

 

I haven't built anything that successfully uses this yet (bitten off more than I can chew for my first project :smile:), but I've tried a few of the examples with this change and it seems to work.
Edited by niklasni1
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the hint! :)

 

I was already aware, that cortex-m4 is currently not selected.

The reason is, that the current MIOS32 toolchain consists of an older gcc version which doesn't support this CPU type.


We've to update the toolchain to a newer gcc version first before doing this change in common.mk.

As long as this hasn't been done (it will require some kind of "qualification" for existing apps, because a compiler change typically causes SW issues; e.g. it happened recently http://midibox.org/forums/topic/13137-midibox-seq-v4-release-feedback/?p=157642'>here) just install any other toolchain and change common.mk locally (like you already did)

 

Best Regards, Thorsten.

Link to comment
Share on other sites

I use the ARM toolchain from Arch Linux's user repository (currently GCC 4.8.1). I can do testing of compiles but I don't have a free MBHP_Core or other hardware. I've got a Discovery board though, obviously.

 

In (somewhat) related news, me and a friend succesfully read from an SD card on his home-made STM32F4-based board. In 4bit mode with DMA we got just under 10MByte per second...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...