2017-03-14 12:50 AM
Hello,
ST, please, do not release untested versions of STM32CubeMX, because we used to trust this software. And now it is just one big BUG... I have updated Cube, because wanted to set STM32F7 hardware JPEG encoder, but other parts just does not work as expected... Lets say I can understand, that newer Cube version 'does not like' older Firmware packages (tried to compile Cube generated code with STM32Cube_FW_F7_V1.4.0, but got 20 errors with missing structures and so on), but I can not understand when functions are missing with newest package (
STM32Cube_FW_F7_V1.6.0)...
All these bugs appears when I select STM32F746NGHx STM32F746G-DISCO board.
Find two differences:
// new code
void MX_SDMMC1_SD_Init(void)
{hsd1.Instance = SDMMC1;
hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; hsd1.Init.ClockBypass = SDMMC_CLOCK_BYPASS_DISABLE; hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; hsd1.Init.BusWide = SDMMC_BUS_WIDE_1B; hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE; hsd1.Init.ClockDiv = 0;}
// and older code
void MX_SDMMC1_MMC_Init(void)
{hmmc1.Instance = SDMMC1;
hmmc1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; hmmc1.Init.ClockBypass = SDMMC_CLOCK_BYPASS_DISABLE; hmmc1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; hmmc1.Init.BusWide = SDMMC_BUS_WIDE_1B; hmmc1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_ENABLE; hmmc1.Init.ClockDiv = 0; if (HAL_MMC_Init(&hmmc1) != HAL_OK) { Error_Handler(); }HAL_MMC_ConfigWideBusOperation(&hmmc1, SDMMC_BUS_WIDE_8B);
}
There are many more bugs, but they are not so much annoying: examples have different structure from cube generated projects, a lot of examples does not work with/without optimizations and so on and on, there would not be end...
Thank You.
2017-03-14 12:53 AM
Is there any place for all STM32cube bugs for all versions?
2017-03-14 02:24 AM
Hi,
Could you please precise the error message that your have and
I
f possible attach your .ioc file.
I will report your issue internally for checking, then we come back to you as soon as possible.
A
bout STM32cube bug tracked, you
can add 'Bug' tag to this discussion, this help you and users to filter by tags and find specific bug as quickly as possible.
All your comments and suggestions are welcome to improve our solutions.
Imen
2017-03-14 03:39 AM
Double checked - the same situation. I have attached *.ioc file, just changed firmware location to my own (it is copy of original firmware).
As You wrote '
All your commentsand suggestions are welcome to improve our solutions.
', here are my few suggestions:Thank You.
________________ Attachments : FAT-disco.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyoB&d=%2Fa%2F0X0000000bCe%2FqTs5gaQZ8mw.xeAlA6QInQPvKiPuo7vO54Js4xdo31A&asPdf=false2017-03-14 06:18 AM
I can confirm that the SDMMC libraries stop working after migrating from Cube 4.18 to 4.20. I use a STM32F746G-Disco board. I also want to try the JPEG library, but after having no access to SDcards, LibJPEG is useless. After some Investigation where the Problems come from, I am sure that the code generated by CubeMX does not work with SDMMC. I also migrated other Projects without SDMMC, they work with Cube 4.20.
I also agree that most libraries need some more 'Hands on' Manuals to be useful.
Just a documentation like in the souce code of the libs
/**
* @brief Gets the current sd card data status.
* @param hsd: SD handle
* @retval Data Transfer state
*/
HAL_SD_TransferStateTypedef
HAL_SD_GetStatus(
SD_HandleTypeDef
*hsd)
{
...
}
is a good reminder when you already had some experience how to use. The HAL documentation is the same.
It Needs a more detailed Explanation how to use the Libs and Software Tools for the first time.
The T.O.M.A.S. Team has some good documents, but they are hard to find online.
>examples have different structure from cube generated Projects
Is there a Special reason for this ? I just guess, the examples use the BSP instead of CubeMX, right ?
I figured out how to use BSP by guessing/try and error and a T.O.M.A.S. Manual, but Fitting the BSP to a custom Project on a Disco board does not save time compared to creating a new Project.
Best regards,
Markus.
2017-03-14 07:19 AM
SDMMC Drivers have been finally rewritten please read the change log on new HAL Drivers... In my opinion they work better, why the name change of some structures I don't know however I wouldn't call this a bug especially that it requires few changes in fatfs/usb drivers. FYI DMA read/write convention has changed, read the header in C file.
2017-03-14 08:53 AM
ChrisH,
yes, I agree with You, that changed functions does not count as a bug, but when you generate code and init functions are missing - it smells like BUG for me. Change log is OK, headers are OK too, but have You read emmc header? I'm talking about higher level functions in file- stm32f7xx_hal_mmc.c, it is written, that if I want to use DMA it is enough to configure, enable ir and read/write, but when I'm using polling method, everything works, and if I do everything step by step as written in header file (working on MSC - USB_HS with eMMC 8 bits)- it stops working. Does it counts as a bug? And nobody is talking about cache or optimizations - strange things starts happening after enabling.
2017-03-14 09:05 AM
I believe that you are facing the same problem as everyone. You need to configure DMA for RX and TX before initiating transfer (it means deinit DMA, configure direction, init DMA, link DMA), you have to do this every time. SDMMC cant simultaneously read and write so one channel is sufficient for both operations. I believe that this is still unchanged in current Hal drivers or maybe it's fixed? Secondly when using fatfs and DMA you need to make sure that data is always 32bit aligned otherwise you gonna get weird results. And also select proorities properly for DMA and SDMMC in NVIC section