Skip to main content
petoknm
Associate
February 26, 2017
Question

STM32CubeMX 4.19.0 Code generation issue

  • February 26, 2017
  • 4 replies
  • 1411 views
Posted on February 26, 2017 at 19:34

Hi.

I have noticed some problems when generating code using STM32CubeMX 4.19.0. I included the zipped project in the attachments. In the Src/main.c file it generates the declaration of the FSMC init function

static void MX_FSMC_Init(void);

but it is never defined. All the other functions get properly defined below the main function but this one does not. It would really help to have this code generated since using FSMC is tricky.

There is also a second issue with the code generation. I have set up a DMA Memory to memory transfer and it generated some code for it but it didn't define the variable is uses. I had to put the variable definition manually in my private global variable definitions.

static void MX_DMA_Init(void) {

   ...

   hdma_memtomem_dma2_stream0.Instance = DMA2_Stream0; /* <------ 

hdma_memtomem_dma2_stream0 is undefined 

*/

   ...

#sram #dma #stm32cubemx #fsmc #code-generation
This topic has been closed for replies.

4 replies

Nesrine M_O
Associate
February 27, 2017
Posted on February 27, 2017 at 10:22

Hi

,

I'am not able to see your issue:

  1. In the Src/main.c file it generates the declaration of the FSMC init function

    but it is never defined:

    * FSMC initialization function */static void MX_FSMC_Init(void){ FSMC_NORSRAM_TimingTypeDef Timing;/** Perform the SRAM1 memory initialization sequence */ hsram1.Instance = FSMC_NORSRAM_DEVICE; hsram1.Extended = FSMC_NORSRAM_EXTENDED_DEVICE; /* hsram1.Init */ hsram1.Init.NSBank = FSMC_NORSRAM_BANK1; hsram1.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_ENABLE; hsram1.Init.MemoryType = FSMC_MEMORY_TYPE_PSRAM; hsram1.Init.MemoryDataWidth = FSMC_NORSRAM_MEM_BUS_WIDTH_8; hsram1.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE; hsram1.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW; hsram1.Init.WrapMode = FSMC_WRAP_MODE_DISABLE; hsram1.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS; hsram1.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE; hsram1.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE; hsram1.Init.ExtendedMode = FSMC_EXTENDED_MODE_DISABLE; hsram1.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE; hsram1.Init.WriteBurst = FSMC_WRITE_BURST_ENABLE; hsram1.Init.PageSize = FSMC_PAGE_SIZE_NONE; /* Timing */ Timing.AddressSetupTime = 15; Timing.AddressHoldTime = 15; Timing.DataSetupTime = 255; Timing.BusTurnAroundDuration = 15; Timing.CLKDivision = 16; Timing.DataLatency = 2; Timing.AccessMode = FSMC_ACCESS_MODE_A; /* ExtTiming */if (HAL_SRAM_Init(&hsram1, &Timing, NULL) != HAL_OK) { Error_Handler(); }}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

  2. I have set up a DMA Memory to memory transfer and it generated some code for it but it didn't define the variable is uses:

/* Private variables ---------------------------------------------------------*/DMA_HandleTypeDef hdma_memtomem_dma2_stream0;SRAM_HandleTypeDef hsram1;�?�?�?�?�?�?�?

-Nesrine-

petoknm
petoknmAuthor
Associate
February 27, 2017
Posted on February 27, 2017 at 21:39

I should have specified that I encountered the issue on Linux. Now I tested it on Windows and it seems to work fine. Can you please test it on Linux?

Nesrine M_O
Associate
February 28, 2017
Posted on February 28, 2017 at 10:10

Hi

Majchrak.Peter

,

The issue has been reported internally for checking .Sorry for the inconvenience it may bring

-Nesrine-