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
- Use MCU : STM32G473VET- Use connectivity : SPI 3 -> Mode : Full-Duplex Slave 1. It it possible to clear Tx FIFO??"FTLVL" It's not '0' value. how to make '0'? The code used is :1)if(spi3_cs_low == true){HAL_SPI_Transmit_DMA(&hspi3, aTxBuffer, 11);HAL_DMA_STATE_CHANGE(&hspi3);HAL_SPI_Receive_DMA(&hspi3, aRxBuffer, 11);HAL_DMA_STATE_CHANGE(&hspi3);}or2)if(spi3_cs_low == true){ HAL_SPI_TransmitReceive_DMA(&hspi3, (uint8_t *)aTxBuffer, (uint8_t *)aRxBuffer, 11);} -- Send data when CS is low and receive the same data many times.-- Is there a code to add? 2. Do I have no choice but to receive Data to update DMA Tx data ?I want to send.SLAVE FIFO buffer update continues. andI would like to send last SLAVE FIFO buffer when I request MASTER writing.Is that possible?? Thank you. I need your help!!
For going to sleep with STM32U535NEY6Q with the following example: ``` cint main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); // ^ // Configure GPIO pin : INT_BUTTON_Pin // | GPIO_InitStruct.Pin = INT_BUTTON_Pin; // | GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; // | GPIO_InitStruct.Pull = GPIO_NOPULL; // | HAL_GPIO_Init(INT_BUTTON_GPIO_Port, &GPIO_InitStruct); while(1) { DEBUG_PRINTF("%d SLEEP\n", HAL_GetTick()); HAL_Delay(100); HAL_PWREx_EnableUltraLowPowerMode(); __HAL_PWR_CLEAR_FLAG(PWR_FLAG_STOPF); __HAL_RCC_PWR_CLK_ENABLE(); HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); DEBUG_PRINTF("%d WOKEUP %x\n", HAL_GetTick(), HAL_GPIO_ReadPin(INT_BUTTON_GPIO_Port, INT_BUTT
Hi :)I would like to acquire n samples from one channel of the on-board ADC (set at 4MHz) every time my EXTI line gets a rising edge (about 25Hz). I am on a STM32L496 on its Nucleo board.I am using ADC1 IN8 single-ended and I am using Regular Conversion as EXTI trigger. I have Continous Conversions enabled and DMA enabled as well.I am starting the conversion with `HAL_ADC_Start_DMA` from the main, which saves the data in a buffer and calls the `HAL_ADC_ConvCpltCallback` once the conversion is done. Now I would like to restart the conversion from the interrupt, but if I call `HAL_ADC_Start_DMA(hadc, ...);` from inside the interrupt I don't get any more conversions. On the other hand, if I call again `HAL_ADC_Start_DMA` from the main the system works as intended.Can I restart the conversion inside the Callback? Is this even the right way to do it?Thank you!!
Applies to: STM32L100xx, STM32L151xx, STM32L152xx, STM32L162xx.Hi,in order to write robust drivers, I'm kindly asking a few questions to developers who are into the silicon design. This is the 1st:ref. RM0038 Reference manual Rev 18, paragraph 27.6.1 Status register (USART_SR) vaguely says that error flag(s):"It is cleared by a software sequence (a read to the USART_SR register followed by a read to the USART_DR register)."which of the following describes the real case:0) "It is cleared by a read to USARTx_DR which happens AFTER a read to USARTx_SR, without any other access in between to the USARTx memory space*."1) "It is cleared by a read to USARTx_DR which happens AFTER a read to USARTx_SR, without any other access in between to the APBx* linked to the USARTx."2) ???(*) see 2.3 Memory map - Table 5. Register boundary addressesThank you very much in advance.
Hi people,The encoder failures can be detected by the timing unit. Transition errors can be found in encoder systems. A state diagram can be used to depict the reading on the two inputs, which equates to a 2-bit gray code. It is predicted that only one bit will change at once. An incorrect transition may result in a transition error interruption.I need to know which callback will be called, when the transition error occurs with corrupted encoder values flow through the channels(Means consider B Channel wire cut off Scenario). And also what kind of configurations needed to pick up the transition error interrupt.Thanks in advance for the solution.Reference : https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9324733/RegardsSanthosh Kumar V
Hi all, I'm truying to adapt one file coming fromm stm32f4 discovery board for using UART. But when I try to add it to my STM NUCLEO L452RE board I got an error : ../Drivers/BSP/uart.c:328:63: error: 'USART_TypeDef' has no member named 'DR'; did you mean 'RDR'? 328 | data = (uint8_t) ((uint16_t) (s_uart1Handle.Instance->DR & (uint16_t) 0x01FF) & (uint16_t) 0x00FF); | ^~ | RDR Here is the function : void USART1_IRQHandler(void) { uint8_t data; uint16_t usedCapacityOfBuffer = 0; uint16_t realCountPutBuffer = 0; if (__HAL_UART_GET_IT_SOURCE(&s_uart1Handle, UART_IT_RXNE) != RESET && __HAL_UART_GET_FLAG(&s_uart1Handle, UART_FLAG_RXNE) != RESET) { data = (uint8_t) ((uint16_t) (s_uart1Handle.Instance->DR & (uint16_t) 0x01FF) & (uint16_t) 0x00FF); realCountPutBuffer = RingBuf_Put(&s_uart1ReadRingBuffer, &data, 1); usedCapacityOfBuffer = UART1_R
Hi STI use the XCube Cellular device for data transmission and AT command operations. However, I find it slightly cumbersome to switch between data and command modes repeatedly. This led me to wonder if there is a way to bring the modem into CMUX (Command Multiplexer) mode.CMUX mode would allow simultaneous handling of data and AT commands, effectively providing a dual interface. This would greatly streamline the communication process and improve the overall efficiency of the device.I didn't find the MUX mode in the list. @Pavel A. Any suggestions
Application is restarting after MODEM_PDN_ACTIVATING_STATE - PDP_ACTIVATED_EVENTthe IP stack running STM32-side with LwIP. G96:Activate PDN (user cid = 1, modem cid = 1) ATCModem:==== CMD TIMEOUT = 15000 ==== ATCModem:atcm_modem_build_cmd returned status = 0 ATCustom:atcc_getCmd returned status = 0 ATParser:*** SEND (size=9) *** ATD*99##<CR> ATParser:ATParser_get_ATcmd returned action = 0x8001 ATCore:**** Waiting Sema (to=15000) ***** IPC:DBG IPC_RXFIFO_readMsgHeader: index_read = 921 IPC:header_byte1[0x80] header_byte2[0x14] IPC:complete=1 size=20 ATD*99##<CR>ATD*99##<CR><CR><LF> BG96 API:enter ATCustom_BG96_extractElement() BG96:input message: size=20 ATCustom:start idx=0 end idx=7 size=8 rank=1 ATCustom:atcc_extractElement returned endmsg = 1 BG96 API:enter ATCustom_BG96_analyzeCmd() BG96:receive an un-expected line... is it a text line ? ATCustom:atcc_analyzeCmd returned action = 0x10 ATParser:analyzeCmd retval = 16 (DAT
Hi, We produced a small batch (50 devices) with STM32L071CZT6, all identical with the same production firmware, and hardware, ... But one of these has an intermittent problem in that the code seems to be fetched from flash differently.The problem does not manifest when stepping through it with the ST-LINK and KEIL IDE debugger, only when executing it normally. When using the KEIL debugger with ST-LINK3 we open a memory window on that flash region and set a hardware breakpoint on an assembly instruction we should never reach just after the failing instruction at 0x08017E70 and just let it run. When it breaks, we sometimes see that both the disassembly view and memory viewer show that from all the flash data, there are 4 bytes different.At address 0x08017E6C the data changed from 0X2905 to 0x6905 and 0xD006 to 0xD406.from0x08017E6C 0x2905 CMP r1,#0x050x08017E6E 0xD006 BEQ 0x08017E7E0x08017E70 This instruction should never be reached and at this address, we have set our breakpoint.in
HiI need to import X-CUBE-OPUS on STM32CubeIde. I have tried to use the embedded software manager in STM32CubeIde but it did not work. My goal is to create a project from scratch and after add these middlewares. What is the correct procedure to do it.Thanks in advance.
Helllo Frends,I am workin on FreeRTOS with STM32f411CEU6 Blackpill. In this I am facing issue with using sleep mode because there is no pin LPTIM1 in the section of TIMERS.I tryed bothe of them CMSIS_V1 and CMSIS_V2. Is there aany Way to use SLEEP MODE
While testing drivers using example BSP from STM32H747-DISCO, everything works fine, but the camera example triggered with a camera init error. Any suggestions will be appreciated.
Hey everyone, I have a problem in understanding the X-CUBE-EEPROM when using it with the STM32G0B1xx. 1. What is meant by kcycles? Does it mean 1000 cycles? The documentation (https://www.st.com/resource/en/application_note/an4894-how-to-use-eeprom-emulation-on-stm32-mcus-stmicroelectronics.pdf) says i have 10kycles per page. One page saves up to 252 elements. Does it mean I can write a 32bit (4 byte) variable 252 * 10000 times? What happens after that?2. I am thinking of implementing my own smaller version of the emulated eeprom. I have 2 variables (8 bytes) which I continuously need to write to the flash. So I could write each variable at a fix memory address, lets say 0x08080000 and 0x08080004. Of course I would loose all the benefits of having data retention, etc. but how often could I write a new value to these addresses? Over the lifetime of my use case (a battery) the variable could be written 300.000 times, at always the same address, is this feasi
I found an error using stm32f429 USB CDC HOST function.Both USB HOST/DEVICE are using stm32f429.I found that when I send data from HOST, sometimes the DEVICE doesn't receive the data.(DEVICE was confirmed to operate normally between usb device and Windows 10)I made the attached test program and debugged it to find the problem.The host transmits data every 100ms and displays the transmitted and received data through UART.(nucleo 429 evk)The device transmits the received data to the host as is, and transmits the transmitted and received data to the uart.(discover429 evk)Looking at the debug message below, the message 'Send test message ABCD => 9181' was sent normally from the host.However, the device side received a message with lenght being 0.In this case, it occurs over several minutes or tens of minutes depending on the situation.It appears to be a problem on the host side, but I cannot tell for sure.Is there any solution for this problem? <host debug message>[00919640]
Hello Community we are using MT29F256G08AUCAB NAND Flash Memory in Our Custom Board and that we Connected with FMC Signal.Also am using HAL NAND Library to Program NAND Flash but there are Several doubts what HCLK Represent and What Value we have to Configure for these below timing and what Basis ? ComSpaceTiming.SetupTime = ComSpaceTiming.WaitSetupTime =ComSpaceTiming.HoldSetupTime = ;ComSpaceTiming.HiZSetupTime = ;/* AttSpaceTiming */AttSpaceTiming.SetupTime = ;AttSpaceTiming.WaitSetupTime = ;AttSpaceTiming.HoldSetupTime = ;AttSpaceTiming.HiZSetupTime = ;PLL Clock is 180 MhzOscillator Clock 24MHzAs there was no Example for NAND Flash Device in STm32Cube. so we can't Decide what Value we have to Give.Kindly Advised Accordingly for it.Am Attaching NAND Flash DataSheetThank YouAman Kumar Gond
Hi everyone,I've been having a problem for several days now. The erasing of Flash memory by sector (or Bank). I'm working on an STM32F439VIT6 and when I use my function in initialisation, before using queues or other things, my function works as I want it to, but when I'm in routine, in my while(1) task for example, it returns errors: HAL_FLASH_ERROR_PGP and HAL_FLASH_ERROR_PGS. Here is an extract from my function: void Erase_Memory(uint32_t nb_sectors, uint32_t sector, uint32_t* pointer_to_zero) { // Disable all interrupts to protect flash operation __disable_irq(); // Suspend task switching to ensure flash access is not interrupted vTaskSuspendAll(); vTaskPrioritySet(plc_g3_handle, 9); // Check and wait until no flash memory operation is ongoing while(__HAL_FLASH_GET_FLAG(FLASH_FLAG_BSY) != RESET) { osDelay(1); // Add delay to allow other hardware operations to complete } // Unlock the flash for erasing HAL_StatusTypeDef flashStatus = HAL_FLASH_Unlock(); while (f
Hi Community,I am using UART + CMSIS v2 + osMessageQueue to pass messages in the main and Model, but when I set a break point in callback function, the debugger does not jump to execution. As described in this post, this prevents me from viewing the contents of the osMessageQueue. I'm using Idle Interrupt in DefaultTask to wait for UART message to be received.Although my callback function works fine, the break point does not work in the callback function, so I can't see what happens when the message is put into the Queue. Does anyone know what I can do? This is my code:Default Task:void StartDefaultTask(void *argument) { /* USER CODE BEGIN defaultTask */ extern UART_HandleTypeDef huart1; extern char RxData[256]; // received data from UART HAL_UART_Transmit(&huart1, "UART1 ready...\n", 15, 0xffff); char cmd[42] = "send_string \"Hello\"\n" "\n"; HAL_UART_Transmit(&huart1, cmd, sizeof(cmd), 0xffff); HAL_Delay(50); /* Infinite loop */ f
Hi, i have a custom board with a STM32 and a Touchscreen.The TSC is connected via I2C to the STM32.There are other I2C slave devices connected to this I2C bus, as well.And i have two threads, a system thread and a gui thread (where Touch GFX is running in). So when a Touch is detected, the TSC is firing an interrupt and the TSC driver is reading the TSC registers.But when i do this TSC driver stuff in a TouchController class it is executed in the gui thread, right?So when in the system thread are I2C accesses to other I2C slaves, too, sooner or later a collision will occur.So the only way to deal with this as i see it is:- ISR of TSC sets a flag bTouchEvent- in the system thead is: { if (bTouchEvent) { Read_Out_TSC_via I2c(); } do_other_I2C_device_stuff }- Driver Instance of TouchController just reads a structure where Read_Out_TSC_via I2c() stored the touch. No I2C acce
当我想进入程序时,应用程序说“文件大小大于等于大小。”我的文件是.hex 怎么解决这个问题呢?stm32f103c8t618:55:25:与设备断开连接。18:55:27 : ST-LINK SN 18:55:27 : V2J34S7 18:55:27 : 通过 SWD 连接。18:55:27:SWD 频率 = 4.0 MHz。18:55:27:连接模式:正常。18:55:27:启用低功耗模式下的调试。18:55:27:设备 ID:0x412 18:55:27:设备闪存大小:32KBytes 18:55:27:设备系列:STM32F10xx 低密度18:55:44:文件大小大于闪存大小。19:03:12 : [FreeJoy_v1_7_1b2.hex] 打开成功。19:03:12 : [FreeJoy_v1_7_1b2.hex] 校验和 : 0x0096951C 19:03:20 : 文件大小大于闪存大小。19:03:42 : 文件大小大于闪存大小。19:05:40 : [FreeJoy_v1_7_1b2.bin] 打开成功。19:05:40 : [FreeJoy_v1_7_1b2.bin] 校验和 : 0x0036395C 19:05:48 : 文件大小大于闪存大小。19:09:47 : [FreeJoy_v1_01b4.hex] 打开成功。19:09:47 : [FreeJoy_v1_01b4.hex] 校验和 : 0x00C6B4F8 19:09:56 : 文件大小大于闪存大小。19:11:46:闪存已擦除。19:12:01 : 文件大小大于闪存大小。
[EDIT: S'OK, I need to think about this more, but I can't find a way to delete a message so am just marking this as one to ignore]I am just moving from STM32F4 to STM32U5. ThreadX seems to be the thing for STM32U5 (if one doesn't want to use Zephyr) but I need to be able to use FreeRTOS also, so I have moved all of my code to CMSIS (V2). However, I am not able to find cmsis_os.h/cmsis_os2.h for ThreadX. For instance, in the STM32F4 case the CMSIS API for FreeRTOS can be found under the Middlewares/Third_Party/FreeRTOS/Source directory.The STM32CubeU5 only contains "template" cmsis_os.h/cmsis_os2.h files but I don't want a template of my RTOS interface, I want the actual RTOS interface that ThreadX will abide by. The cmsis_rtos_threadx directory of STM32CubeU5 only contains the .c file, no headers. The ThreadX repo doesn't contain a CMSIS adaptation at all.Where do I find the CMSIS adaptation API that ThreadX will abide by?
Hi,We're using the STM32 HAL layer(STM32G0xx_HAL_Driver v1.6.1) for I2C and see that when re-enabling the I2C listen interrupt, the HAL_I2C_ListenCpltCallback is called twice. This results in that the first I2C read cmd works but the second after that fails.Our callback:void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *i2c_handle){ if (my_i2c.state == MY_I2C_STATE_DONE) { my_i2c.state = MY_I2C_STATE_RX_ADDR; HAL_I2C_EnableListen_IT(i2c_handle); }}The reason for this seems to be that we're calling HAL_I2C_EnableListen_IT from interrupt/HAL context.What seems to happen in I2C_Slave_ISR_IT are these calls:1. I2C_ITSlaveCplt(5036) -> HAL_I2C_ListenCpltCallback(6173) -> our function above2. our function above -> HAL_I2C_EnableListen_IT3. I2C_ITListenCplt(5053) -> HAL_I2C_ListenCpltCallback(6256) -> our function aboveWhat happens is that function in 2 above changes the HAL internal state to:hi2c->State = HAL_I2C_STATE_LISTEN whil
Hello, i am trying to make a file with a text on a SD card without success.I followed this tutorial:https://community.st.com/t5/stm32-mcus/how-to-create-a-file-system-on-a-sd-card-using-stm32cubeide/ta-p/49830But i have a stm32h743zit6 and it is a bit different.First, I can't configure DMA on SDMMC in stm32cubemx.I've configured the pins of the stm to the pins slot i have in my board (Is a custom board made by me using this microcontroller and the sd card slot.)I activated in cubemx: DMA (I think it is not necessary), SDMMC, FATFS, GPIO and freertos (for threads in the future).Then, i wrote a simple code shown in the tutorial: /* USER CODE BEGIN 1 */ FRESULT res; //Fatfs function common result code uint32_t byteswritten, bytesread; // File writes/read counts uint8_t wtext[]= "PRUEBA ESCRITURA"; //Buffer de escritura de archivo uint8_t rtext[_MAX_SS]; //Lectura de buffer de fichero /* USER CODE END 1 *//* USER CODE BEGIN 2 */ if(f_mount(&SDFatFS, (TCHAR const*)SDPath, 0) != F
MCU = STM32L433RCTxSTM32 CubeIDE version - 6.8.0I'm working on sd card operation using sdmmc 4-bit mode but it is not working. but when I select 1-bit sdmmc mode so it is working as well.I want to know how can I resolve this issue. my sd card connector is MSD-4-A and there are all line connected with 47k pullup resister leaving CLK pin.SDMMC Init -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_4B;hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;hsd1.Init.ClockDiv = 4;there are lots of post available related this issue but can not clear proper solution. In some post there are talking bug in firmware in latest version. if yes so how can I resolve it.Thanks in advance.
Premises:- built with gcc version 11.3.1 20220712 (GNU Tools for STM32 11.3.rel1.20230912-1600)- verified on STM32L151RC- cross reference to crc: https://reveng.sourceforge.io/STM32L1xxxx CRC module can compute crcs compliant to the following 4 standards: - CRC-32/ISO-HDLC* - CRC-32/JAMCRC - CRC-32/BZIP2 - CRC-32/MPEG-2(*) ISO-HDLC is implemented in these softwares: WinRar, ExamDiff, FreeCommander, HashMyFiles.CRC module digests one int32 at a time, it doesn't digest byte-per-byte, so the input data must be a stream of m bytes, where m is multiple of 4: m == n * 4, having its base address aligned to uint32_t. That's why the byte stream is passed as uint32_t data[] in the examples.Given the MCU endianness and the CRC module implementation, in order to meet the wanted results each dword must be bit-reflected for ISO-HDLC/JAMCRC while it must be byte-reversed for BZIP2/MPEG-2. Once all the data has been digested, crc
Hi everyone. I'm currently working on a legacy project that only runs on Zephyr V3.2.0. I have to use the hal_stm32 to get some peripherals running (https://github.com/zephyrproject-rtos/hal_stm32). The latest version of hal_stm32 is not compatible with Zephyr V3.2.0. How can I switch to an older release of hal_stm32? I haven't seen any branches or tags that would hint to the right STM32_hal version. Best regards Maikel
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.