Skip to main content
jasonforest9
Associate II
June 14, 2017
Question

32F412G DISCOVERY

  • June 14, 2017
  • 10 replies
  • 3318 views
Posted on June 14, 2017 at 18:04

I have a 32F412GDISCOVERY (the one with LDC) board and the stock demonstration firmware is nowhere to be found. I can find the firmware to other discovery boards, but not this one. How can I obtain this firmware source code package?

    This topic has been closed for replies.

    10 replies

    waclawek.jan
    Super User
    June 14, 2017
    Posted on June 14, 2017 at 18:12

    [STM32Cube_FW_F4_V1.15.0]\Projects\STM32F412G-Discovery\Demonstrations\

    JW

    jasonforest9
    Associate II
    June 14, 2017
    Posted on June 14, 2017 at 18:25

    So the stock 

    STM32F412G-Discovery firmware is only available from the stm32cubemx application download? 

    waclawek.jan
    Super User
    June 14, 2017
    Posted on June 14, 2017 at 18:33

    No, you can download the

    http://www.st.com/en/embedded-software/stm32cubef4.html

    library without CubeMX being installed.

    JW

    jasonforest9
    Associate II
    June 14, 2017
    Posted on June 14, 2017 at 19:19

    Looks like this may be it. I was expecting a more dedicated package that is specific to the 32F412GDISCOVERY like they do for other dev kits (like the STM32F4-Discovery board page). A 30MB zip file is easier to handle than a 400MB one . And the other board packages have projects created already for MDK for example. I'll see what comes of what you listed.

    Tesla DeLorean
    Guru
    June 15, 2017
    Posted on June 15, 2017 at 01:42

    The SPL code from the DSP Library works with the F412, but no tailored examples. Ported some of my microSD card logging software to the board. Need to check the BYPASS errata for SDIO as this is supposedly not on the F412.

    http://www.st.com/en/embedded-software/stsw-stm32065.html

     
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    June 16, 2017
    Posted on June 16, 2017 at 04:15

    Does appear to fix the BYPASS issue, 19.7 MBps read on a SanDisk Ultra PLUS 32GB (10 MBps write), 15.9 MBps on a Verbatim Ultra 16GB

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    waclawek.jan
    Super User
    June 14, 2017
    Posted on June 14, 2017 at 19:55

    That was before the Cube era and the package you mention is based on the deprecated SPL. These days all ST devboards have Cube support exclusively.

    Some are supported in mbed, but that's based on Cube anyway.

    IIRC Cube contains MDK projects.

    JW

    jasonforest9
    Associate II
    June 15, 2017
    Posted on June 15, 2017 at 01:57

    Unfortunately I'm getting hard fault error when I run the code listed under 

    Demonstrations for this discovery board. When it tries to write to the LCD it turns it on with a white background and then freezes. I was able to debug it down to the line where it tries to display the ST logo. If I comment it out, it goes forward but hard faults after in another routine that I haven't checked yet.

    Has anyone tried the MDK project with Keilv5 from this path:

    \STM32Cube_FW_F4_V1.16.0\Projects\STM32F412G-Discovery\Demonstrations\MDK-ARM

    It compiles just fine and downloads ok. Like I said, if I skip the ST logo, it then prints 'life augmented', and hard faults somewhere after that.

    Bogdan Golab
    Lead
    June 15, 2017
    Posted on June 15, 2017 at 11:05

    Hi,

    I am also playing with this board right now. The demo worked fine but as usual in wanted to generate CubeMX code myself (from the scratch) because re-using ST examples (not generated by the CubeMX) is difficult to integrate with Cube generated code.

    You can try my Cube project file where the drivers are configured for LCD TFT and Touch Screen:

     

    Bogdan

    jasonforest9
    Associate II
    June 15, 2017
    Posted on June 15, 2017 at 19:03

    Bogdan, Thanks for the code.

    It seems to go into an infinite loop during the HAL_Delay routine.  It is not incrementing as it should. The code where it is stuck is below. The first time it goes here is during the BSP_LDC_Init. Any ideas?

    __weak void HAL_Delay(__IO uint32_t Delay)

    {

    uint32_t tickstart = HAL_GetTick();

    uint32_t wait = Delay;

    /* Add a period to guarantee minimum wait */

    if (wait < HAL_MAX_DELAY)

    {

    wait++;

    }

    while((HAL_GetTick() - tickstart) < wait)

    {

    }

    }

    __weak uint32_t HAL_GetTick(void)

    {

    return uwTick;

    }
    Tesla DeLorean
    Guru
    June 15, 2017
    Posted on June 15, 2017 at 19:15

    You need to have called HAL_Init() and have the SysTick handler calling into the HAL

    void SysTick_Handler(void)

    {

    HAL_IncTick();

    }
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    jasonforest9
    Associate II
    June 15, 2017
    Posted on June 16, 2017 at 01:35

    Bogdan, did you use Keilv5 to compile it? 

    Tesla DeLorean
    Guru
    June 16, 2017
    Posted on June 16, 2017 at 23:42

    Just pulled Cube F4 v1.16, and built with Keil uV5.22

    Doesn't have a Flash Algorithm for the SPI NOR Flash at 0x90000000, so used the ST-LINK Utilities to burn instead of Keil, but seems to run without faulting.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Bogdan Golab
    Lead
    June 16, 2017
    Posted on June 16, 2017 at 14:53

    Yes, Keil v5 is my favorite one.

    jasonforest9
    Associate II
    June 16, 2017
    Posted on June 16, 2017 at 17:22

    And your discovery board is stock? Nothing changed?

    jasonforest9
    Associate II
    June 16, 2017
    Posted on June 16, 2017 at 18:54

    Thanks for everyone's help. I'm kinda giving up for now on this demonstration code. I can't get it to run properly for some reason. I was able to run the RTC_TimeStamp and BSP example projects. The RTC_TimeStamp ran fine, and the BSP one worked up to the point of the audio recording, at which time it displayed 'DMA Error' on the screen. I've got enough to know that the LDC works and I'm not about to keep debugging this ST code. I'd rather start work on my project and work things out as I build it.

    Tesla DeLorean
    Guru
    June 17, 2017
    Posted on June 17, 2017 at 21:17

    Probably a wise move, better you build your apps the way you are comfortable with, and strip out the pieces you need from demo/example code as you need to, rather than try and add stuff into code built with a different mindset.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Bogdan Golab
    Lead
    June 16, 2017
    Posted on June 16, 2017 at 21:04

    Just bought it, updated the CubeMX with the latest STMF4 drivers. The demo was already uploaded to the STM32F412-DISCO board.

    Bogdan Golab
    Lead
    June 16, 2017
    Posted on June 16, 2017 at 21:10

    I updated the CubeMX just to start my regular goal: recreate the drivers using CubeMX.

    I want to say that the demo was already uploaded to the new board  - the only purpose of the CubeMX refresh was to have 'latest & greatest' drivers for driver generation.