Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I am using STM32H7B3I-DK running a touchgfx application and acting as SPI Master, and Nucleo-H743ZI as SPI Slave. Both are configured in interrupt mode not using HWNSS. The Master is sending 1,2,3,4,5,6,7,8 but the slave is receiving random numbersI am sending one byte at a time and receiving one byte then adding it to a buffer. I want to avoid HAL overhead as much as possible as the data needs to be close to real time. The Master seems to send quickly enough using HAL_SPI_Transmit; however, the slave would only receive every other byte, hence the avoidance of HAL on the Slave side.The master is properly sending data, as checked by oscilloscope. I have double checked the compatible settings for Master-Slave communication in the .ioc files such as Data Size, First Bit, etc...Here is my following relevant code for the master: hspi2.Instance = SPI2; hspi2.Init.Mode = SPI_MODE_MASTER; hspi2.Init.Direction = SPI_DIRECTION_2LINES; hspi2.Init.DataSize = SPI_DATASI
This is a question about programming style, preferences, efficiency, and risk.We are working on a state machine were multiple conditions are checked for a potential state transition. We are debating what is better, safer, more efficient, or simply more elegant: goto LABEL, or if else() blocks? The goto statement is simple, but if else() blocks are perhaps more robust in a team environment. See options 1 and 2 below. What do you recommend? Thanks!Option 1: if (condition_1 true){ [do something] goto END_OF STATE;}if (condition_2 true) [do something] goto END_OF STATE;Option 2:if (condition_1 true) [do something]else if (condition_2 true){ [do something]}
We are currently using the ST32F4 MCU.During operation, we are using self-diagnostic code provided by ST, but after 8 days of normal operation, an EXT_SOURCE_FAIL occurs in STL_MainClockTest(), causing the MCU to reset.When EXT_SOURCE_FAIL does not occur, the PeriodValue is measured between 11,500 and 11,800. However, when the error occurs, the PeriodValue is around 23,000, approximately twice the normal value.The function for calculating the Period Value is as follows: HSE is operating at 25MHz, and LSI is operating at 32kHz.We are using TIM5's Ch4 for INPUT Capture, and the detailed settings for INPUT Capture are as follows: Questions:We are currently using tim_input_config.ICPrescaler with TIM_ICPSC_DIV4. Is it acceptable to change it to TIM_ICPSC_DIV8?What is the difference between TIM_ICPSC_DIV4 and TIM_ICPSC_DIV8?What is the meaning of the ICFilter value, and could changing it prevent errors?
Hi All,I'm having a terrible (fun) time trying to get the DP83848 to work with the STM32H743 (RMII).No packets, no interrupts, nothing. - it's just dead to the world.I can get things working with the LAN7842 and I can get the DP83848 working with the F7 series no problems.I have tried everything I can think ofPlayed around with different SRAM and MPU configs - all set up correctly I think (as per LAN7842 etc)I've tried importing the DP83848 stuff from the F7 HAL librariesI've modified the LAN7842 headers to 'work' with the DP83848tried countless examples and ideas from this forumspent nearly all week on it!I read the excellent post " How to create a project for STM32H7 with Ethernet and LwIP stack working" byfrom @Adam BERLINGER where he states the followingunfortunately when LAN8720 is used in REF_CLK_OUT mode (RMII clocks generated by PHY), the timing is not compatible with STM32H7. In that case the RXD output hold is 1.4ns minimum on PHY side, while STM32H7 requires at l
Hello there. I am working on STM32G030 based FW. It appeared the TIM1x_CH1N doesn't work. I found out this part of code doesn't initialize negative channel(stm32g0xx_hal_tim.c). Moreover it may skip all channels configurations. It seems to be a hard coded part that initializes only positive channel with defined CxP and CxN options if so it really skip user predefined ones. Could you fix this issue and update HAL driver sources? Thank you in advice.
Hello,Today, I was receiving my eeprom data normally with my normally working I2C code, but when I entered debug mode, the uwtick increased on my processor, but it was not receiving my commands. The LED indicating that the code was running was not blinking. After some time I noticed that in debug mode the commands were not working but when not in debug mode it was working.Setting & Code static inline void EEPROM_Write(uint16_t memAddress, uint8_t* data, uint16_t dataSize) { HAL_I2C_Mem_Write(&hi2c1, EEPROM_ADDR << 1, memAddress, I2C_MEMADD_SIZE_8BIT, data, dataSize, HAL_MAX_DELAY); } static inline void EEPROM_Read(uint16_t memAddress, uint8_t* data, uint16_t dataSize) { HAL_I2C_Mem_Read(&hi2c1, EEPROM_ADDR << 1, memAddress, I2C_MEMADD_SIZE_8BIT, data, dataSize, HAL_MAX_DELAY); } void Main_Loop(){ /* System Init*/ HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1); HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1); HAL_TIM_PWM_Start(&htim1, TIM_CHANNE
I had debugging problems with a H7 target, and by stepping thru the boot process I found the following line in SystemInit(): /* * Disable the FMC bank1 (enabled after reset). * This, prevents CPU speculation access on this bank which blocks the use of FMC during * 24us. During this time the others FMC master (such as LTDC) cannot use it! */ FMC_Bank1_R->BTCR[0] = 0x000030D2; At this stage of the boot process, the FMC power is not enabled, and thus reading or writing the register has no effect. Am I overseeing something or is this line for confusion?
i have interfaced stm32 and Sd card performed different operations separately and i have interfaced stm32 and tft wave share(ili9486) display and able to display some graphics separately ,now i am trying to fetch a image from sd card and display it on the LCD but i am able to communicate with only one slave and if Sd card works display does not work and vice -versa and i am using Arduino ide for coding. Please help me to solve this #include <spi.h> #include <SD.h> #include <Adafruit_GFX.h> #include <Waveshare_ILI9486.h> #define SD_MOSI_PIN PC12 // MOSI Pin #define SD_MISO_PIN PC11 // MISO Pin #define SD_SCLK_PIN PC10 // Clock Pin #define SD_SS_PIN PB0 // Chip Select or Slave Select Pin #define TFT_CS_PIN PB6 #define TFT_DC_PIN PA8 #define TFT_RST_PIN PA9 #define BLACK 0x0000 #define BLUE 0x001F #define RED 0xF800 #define GREEN 0x07E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define WHITE 0xFFFF #define BUFFER_SIZE 50 char textBu
All my code works on RTOS.When I enable D-Cache,fs_mount() from FATFS on SD card returns FR_NO_FILESYSTEM,SD card can not work.When I disable D-Cache, fs_mount() returns FR_OK, SD card can write and read.But at the same time , i need to use Ethernet on my device . When I close D-Cache, my Ethernet can not work.How can I resolve these two conflicting issues?
Hi, I am using STM32h735g-dk development board, STM32CubeProgrammer and ST link to flash the development board. I tried to flash program the development board using the ST link and STM32CubeProgrammer. Once, it got programmed, but after some time, I tried to program the same board again using the USB cable with the onboard ST link programmer; it did not get programmed.Now its giving me this below error in STM32 Cube Programmer and its not getting connected."15:56:35 : UR connection mode is defined with the HWrst reset mode15:56:40 : ST-LINK error (DEV_USB_COMM_ERR)15:56:40 : Error: Problem occurred while trying to connect" Checked on the device manager, and there on ports "board is not getting detected" but is showing me on the Universal Serial bus devices. Screen shot attached below for your reference.And check on STM32 Cube IDE, here also the same issue is "No device found". Kindly let me know, what would be the issue and please revert me back if there are any add
I have build a IAP bootloader at 0x8000000 and test with a simple blink app at 0x8040000 which works fine but if I add FreeRTOS for the same blink app at 0x8040000 its not working. It jump to the blink application but it doesn't pass the SystemClock_Config() function while under debugging. Did I miss anything to configure?/* Blink app */ int main(void) { /* USER CODE BEGIN 1 */ SCB->VTOR = 0x8040000; /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); /* USER CODE BEGIN 2 */ while(1){ HAL_GPIO_WritePin(GPIOB,GPIO_PIN_0 | GPIO_PIN_1,GPIO_PIN_S
I'm trying to program an STM32L011F4 to transmit data through USART2 by way of the DMA controller. My code compiles but the IRQ handler for DMA is never called. Either I have not correctly initialized the DMA controller or there is another problem I am overlooking. Can anyone provide suggestions? //----------------------------------------------------------------------------- #include <stdio.h> #include "stm32l0xx.h" //----------------------------------------------------------------------------- #define USART_TX_PIN GPIO_PIN_2 #define DMA_BUFFER_SIZE 64 uint8_t dma_buffer[ DMA_BUFFER_SIZE ] = "String to send through USART2 by DMA!\r\n"; //----------------------------------------------------------------------------- void SystemClock_Config(void); void USART2_Init(void); void DMA_Init(void); void Start_DMA_Transmission(void); //----------------------------------------------------------------------------- int main( void ) { SystemClock_Config(); // Conf
Delete
On a STM32G030 MCU, i have Timer-1 (Channel 2) configured in "Input Capture Mode" and is running at 4 Mhz (64 prescaled by 16), So effectively the TIM1 counter increments at every 0.25uS. This is used to measure "On time" of a LED strobe-Light on a GPIO line(which can be as wide as 20 microsec multiple times in a span of 16 millisec window slot).The approach : Set timer-1 trigger for rising edge,on rising edge interrupt start the timer-counter and reset trigger for falling edge, and on falling edge, stop the counter and read the counter difference and set back to rising edge again. div the difference by 4 gives you the pulse ON time in micro sec.The measurement happens correctly for most of the time .. but often(every 20 sec or so) i noticed that the timer counter adds a value of 1000 incorrectly. I arrived at this number by repeated captures on this error and its always been 1000 more. 1000 implies its 250 microsec more. The strobe pulses are very regular in the system and i confrmed
I'm trying to output a triangular wave, i'm very new to this so let me know if i'm doing anything wrong. I'm using stm32 f3 discovery board with stm32f303vc, I selected circular mode, started timer 7 with some frequency and update event mode, configured dma with channel 3 so it can go to dac channel 1. I'm trying to lookout for the transfer complete interrupt, when detected i'd like to increment dac channel 2 value. however i'm not sure how to look for the interrupt? i'm using HAL and i looked through the examples but i couldn't find how to enable the appropriate interrupt and how to look for it. I found a callbackmethod in dac.c that was weak type and i defined that in my main.c file and put a break point in it. but nothing happened i think because i haven't enabled the interrupt. I was also wondering if circular mode would be appropriate for my needs, is normal mode better for this? but i'm not sure who to trigger the dma manually. Any links to tutorials and helpi
Hi everyone, I am currently working on a project that involves running an HTTPS server on the STM32H563 microcontroller using the Cyclone TCP stack and ThreadX. As part of our evaluation process, I built the HTTPS server demo project (FreeRTOS) on a NUCLEO-H563ZI board provided by the Cyclone TCP team. Here are the static memory usage details: RAM Usage: data: 1.73 KB bss: 308.7 KB Total RAM: 310.43 KB (640 KB on the board, approximately 50% of the available RAM) FLASH Usage: text: 338.5 KB (2 MB on the board) Given that the RAM usage is already at 50%, I am concerned about the remaining resources for other functions that the system will need to perform. I understand that ThreadX + NetXDuo is an option, but we want to have more security covered, so we are more interested in the CycloneTCP solution. Has anyone run an HTTPS server on the STM32H563 with Cyclone TCP and ThreadX? What are the typical RAM and FLASH usage? Are there any external RAM or FLASH requirements for this setup? A
HI, I am trying to implement ST7567 GLCD (128x64) with SPI on my STM32G0B1RCT6 MCU. Unfortunately i am not getting the Example Driver, i tried my self but there is no improvement, So Any one Kindly send me the STM32 related ST7567 GLCD Example
How to enable HRTIMER system faults? I have successfully used faults coming from other peripherals to turn off HRTIMER outputs (e.g. internal comparators), but can't get system hard faults to produce the same result. I have enabled all faults in the SYSCFG_CFGR2 register. What else needs to be configured?Thanks!
Hello Support Team,I have configured SPI2 (for STM32H745 board)from STM32Cube configuration and enable global interrupt.I have used simple HAL_SPI_TransmitReceive_IT() API for transmit as well as receive the data.But In IRQ handler no any interrupt generated for SPI transmit call.Normal Polling mode is working fine for me.But issue faced in interrupt mode.Could you give the any example link which is working fine for STM32H745 Discovery board.Below I have attached my code please look into these.If found any issue or miss configuration suggest that configuration for proper work.SPI Handle Configuration which is configured in STM32H745.#ifdef MASTER_BOARD hspi2.Init.Mode = SPI_MODE_MASTER;#else hspi2.Init.Mode = SPI_MODE_SLAVE; HAL_Delay(10);#endif /* USER CODE END SPI2_Init 1 */ /* SPI2 parameter configuration*/ hspi2.Instance = SPI2; hspi2.Init.Mode = SPI_MODE_MASTER; hspi2.Init.Direction = SPI_DIRECTION_2LINES; hspi2.Init.DataSize = SPI_DATA
Hi,I have developed a Keyboard using USB communication protocol and i am facing an issue, when i want to debug the code and parallelly i want to see whether the alphabet is printing or not. This is not happening when i want to see both simultaneously.so i am getting the above dialogue and only its going into debug but it is not communicating for keyboard. Thank you.
Hey, I am trying to find drivers for a 320x240 adafruit display that work on the STM32U5 without using the HAL. I cannot seem to find anyone who has a ST7789 driver that does not use the HAL. Have any of you used the ST7789 with the STM32U5? Any help would be appreciated. Thanks.
In the STM32H5 HAL, the file stm32h5xx_util_i3c.h was not included in the compilation list because it does not contain protection with the #if defined (USE_FULL_LL_DRIVER) flag, even though it uses the LL driver. This absence of protection results in a compilation error when the USE_FULL_LL_DRIVER flag is not defined.Steps to Reproduce:Attempt to compile a project that references stm32h5xx_util_i3c.h without defining USE_FULL_LL_DRIVER.Observe the compilation failure due to missing flag protection in the file.Suggested Solution:Add conditional compilation protection around the code in stm32h5xx_util_i3c.h using #if defined (USE_FULL_LL_DRIVER). This would prevent compilation issues when the full LL driver is not in use.
Hi,I am using the STM32H745 and facing the following issue:ADC with DMA1 works fine when the DMA2 block is not reset.ADC with DMA1 fails when the DMA2 block is reset(in RCC->AHB1RSTR). The "DMAMUX request line multiplexer (DMAREQ_ID field in the DMAMUX_C0CR register)" resets back to 0.It appears that the DMAMUX is closely tied to both DMA controllers (DMA1 and DMA2). None of the available documents (es0445-stm32h745-errata, rm0399 - Reference Manual, en.STM32H7-DMAMUX, en.STM32H7-DMA) provide the required information on this behavior.Is this the expected behavior? Are there any documents from STM32 that can justify this? some help would be greatly appreciated. Thanks
I tried the following code in a STM32F107:RCC->AHBENR = RCC->AHBENR | RCC_APB2ENR_IOPBEN_Msk| RCC_APB2ENR_IOPDEN_Msk;and RCC->AHBENR = RCC->AHBENR | 0x00000008 | 0x00000020;When I display RCC->AHBENR, it always shows 0001C014.I expected to see 0x0001C03C.I found this because Ethernet never finished resetting.
I am trying to make a very simple SPI ISR to read the RXDR and store the value to a buffer. However, I cannot get the ISR to even trigger without using HAL_SPI_Receive_IT(). I do not want to use the callbacks or the default IRQ generated by cube. I currently just have the following in my ISR: void spiISR(SPI_HandleTypeDef *hspi){ if (__HAL_SPI_GET_FLAG(&hspi1, SPI_FLAG_RXNE)) { rxBuffer[rxIndex] = SPI1->RXDR; // Increment index and wrap around if necessary rxIndex = (rxIndex + 1) % RX_BUFFER_SIZE; __HAL_SPI_CLEAR_OVRFLAG(&hspi1); } } Since I don't want to use the generated IRQ I do this: void SPI1_IRQHandler(void) { /* USER CODE BEGIN SPI1_IRQn 0 */ spiISR(&hspi1); return; /* USER CODE END SPI1_IRQn 0 */ HAL_SPI_IRQHandler(&hspi1); /* USER CODE BEGIN SPI1_IRQn 1 */ /* USER CODE END SPI1_IRQn 1 */ } I have turned on the following: MX_SPI1_Init(); /* USER CODE BEGIN 2 */ HAL_NVIC_EnableIRQ(SPI1_IRQn); __HAL_S
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.