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
Hi,I am working on an external loader for STM32G491.For STM32F4 series microcontroller, everything works fine, but STM32G491 does not work.I observed that the external loader program is loaded into RAM, but does not execute.I did some tests with running the program from RAM in debug mode.I observed that if the FLASH memory is erased then the program loaded into RAM does not want to start (see image below).If there is any previous running program in FLASH memory, then loading the test program into RAM and running it with the debugger works fine.For STM32F4 series microcontroller, I can always run the program from RAM ( also for deleted FLASH memory - which seems to be normal).The problem with the external loader is that the debugger initially deletes the processor's FLASH memory, then using the external loader to erase the external memory, but the external loader no longer works, because the FLASH memory is deleted.I use CubeIDE Version: 1.14.0 & HAL library &
// DMA RX 설정 __HAL_RCC_DMA1_CLK_ENABLE(); // DMA1 클럭 활성화 hdma_rx.Instance = DMA_USART1; hdma_rx.Init.Request = DMA_REQUEST_USART1_RX; hdma_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; hdma_rx.Init.PeriphInc = DMA_PINC_DISABLE; hdma_rx.Init.MemInc = DMA_MINC_ENABLE; hdma_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; hdma_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; hdma_rx.Init.Mode = DMA_CIRCULAR; // 순환 모드 hdma_rx.Init.Priority = DMA_PRIORITY_LOW; if (HAL_DMA_Init(&hdma_rx) != HAL_OK) { return IMU_INIT_FAILED; } __HAL_LINKDMA(&huart, hdmarx, hdma_rx); if (HAL_UART_Receive_DMA(&huart, &q_buf[0], DMA_BUFFER_IMU) != HAL_OK) { return IMU_INIT_FAILED; } Delay_ms(1); __HAL_UART_CLEAR_FL
Hello,I have simple project in assembly and can't understand/explain why one time delay loop takes much longer than the other one (LEDs should be blinking one on, second off and vice versa). But one such state takes approx. 5 times more time than the other, although loops seem to be written equally demandingMaybe I'm doing something obvious wrong. BTW, we have also spotted such behaviour also on some other projects - one loop taking much more time, although it should take same time. I've tried running the code from Flash or RAM and same happens in both situations.Any hint, advice? Thanks... Short description: main loop has two identical SW delay loops, in between on/off state is written to 3 variables. SysTick Handler is triggered each ms and reads the state of variables and reflects to real outputs. Green LED is on approx. 5 times longer that red one. /* * Main.s */ .syntax unified .cpu cortex-m7 .thumb /////////////////////////////////////////////////////////
Hello could anyone advise where to find the example projects (demonstration code) for F407 discovery board? the code that was embedded when you first get hold on the new board before starting programming, where the 4 LED blink according to the onboard gyro; and the code for i2s onboard.i had started programming the board and therefore the demo code was deleted...
Hello,We are using STM32H745XIH6 Microcontroller for our designed custom boards. We have designed two boards named controller card (i.e. with the mentioned microcontroller mounted) and the other Power supply card.The I2C signals are generating from the controller card to the power supply card through the connectors.There is no problem with the I2C signals in the Controller card and also in the connector side of the power supply card, when two cards are stacked together.the I2C signals are unable to generate from the connector side to the other side in the power supply card i.e a level translator is mounted taking the I2C Signals from the connector in input side and generating the same I2C output signals so that the clock and data signals will go to the respective IC's in the Power supply Card(attached a Png image of our circuit for reference). The speed that I have configured for checking I2C is 100KHz.The provisions are made as per the point 3 & 4, but we are unable to get the sig
I am working on a data logger project using SDIO with DMA and FreeRTOS. The only sensor currently in use is the BME280, which is working fine. However, I am encountering issues when writing the CSV file, such as glitches, character repetition, and other seemingly random problems. Here is the relevant code: /* USER CODE BEGIN Header_StartSDTask */ #define BUFFER_SIZE 4096 #define BUFFER_THRESHOLD BUFFER_SIZE/4*3 #define HEADER "Time;BaroTemperature;BaroPressure;BaroHumidity;PitotTemperature;PitotDiffPressure;Latitude;Longitude;IMUax;IMUay;IMUaz;IMUgx;IMUgy;IMUgz;IMUmx;IMUmy;IMUmz\n" char buffer[BUFFER_SIZE] = HEADER; uint8_t sensorsResponse; uint16_t adress = sizeof(HEADER) - 1; uint32_t maxAdress; uint32_t lastTime; uint16_t count = 0; uint16_t count2 = 0; char adressCarac; void bufferize() { adress += snprintf(&buffer[adress], (BUFFER_SIZE - adress), "%lu;", lastTime); // Additional sensor data processing... } /** * @brief Function implem
Hello,I'm using the STM32F407 board. I'm trying to implement FreeRTOS on a smart parking system but when using the RFID i need to define SysTick_Handler two times. How can i resolve this problem.
Hi all and merry Christmas!It's Christmas time again and therefore it's time for me specifically to work on my private projects. I want to build up a rather complex device running on ThreadX and just wanted to play around with ThreadX trying to understand it. But I'm struggling even on a simple setup.The current state of my code is:- one main thread created from the .ioc file by CubeIDE with priority 10- 2 user threads coded by myself using same priority (11) etc.One of which is a simply blinky, the other one is sending a string on USART2 interface- 1 interrupt triggered by an EXTI (Pushbutton) sending a string on USART2 interface Both user threads are designed with a while loop as it was the way given in all examples I found and I also noticed that without the while loop, the entry-function is run once only (of course also with the while loop it is triggered once, but due to the while loop always repeating).I'm having issues understanding the scheduling of ThreadX I think. I do h
When I try to set up a HAL_UART_Receive_IT my program won't compile.I am new to the FreeRTOS concept, but it is necessary for me to learn how to set it up for a project I am working on. For that, I started restructuring a previous project to learn from the process. I stumbled with the problem of me not knowing how to setup a UART interrupt when using tasks. I tried reading online on how to do it. This is what I have done so far:In my .ioc file I enable FreeRTOS using CMSIS V2Using the .ioc configurations I enabledfour tasks with the same prioritytwo queuesone Semaphoreone MutexI enable UARTS 1,2 and 3I enabled global interrupts for all the UARTSI tested tasks by making a LED blink. But when I tried to set up a HAL_UART_Receive_IT my program wouldn't compile. My guess is that I have a bad case of I-am-a-rookie. But I tried this:I tried calling the function from the main() setup before the osKernelStart() instruction, but it failed. I tried calling it inside one of the tasks but it
I generally want to support both static/auto/dhcp in software config. This is most easily done by changing LWIP.c Around line 62: /* IP addresses initialization with DHCP (IPv4) */ ipaddr.addr = gstate.ipaddr; // NOT 0 netmask.addr = gstate.netmask; // NOT 0 gw.addr = gstate.gwaddr; // NOT 0 Around 92 if (gstate.dhcp) { dhcp_start(&gnetif); } else { ipaddr.addr = gstate.ipaddr; netmask.addr = gstate.netmask; gw.addr = gstate.gwaddr; dhcp_stop(&gnetif); netif_set_down(&gnetif); netif_set_addr(&gnetif, &ipaddr, &netmask, &gw); if (netif_is_link_up(&gnetif)) { /* When the netif is fully configured this function must be called */ netif_set_up(&gnetif); } } However such changed keep getting trampled on by code generation when I update STM32Cube. Is there any way to protect changes so they don't get overwritten? I appreciate that to support either Static or DHCP this is a config option in the code generator, b
Moved from the Feedback ForumHi,1. Referring to below link, can we use this for STM32L562ZET6Q part without any change.2. What changes are to be done to make use of USART3 (PC10,PC11) rather USART1 (PA9,PA10). How to use the ST Open Bootloader for STM32 Microc... - STMicroelectronics Community
We are performing SPI communication using DMA.In this case, we manually set the GPIO to High/Low as SPI_CS, but (obviously) SPI_CS goes High before all of the SPI CLK is sent.How can we manually return SPI_CS to its original state after all of the SPI CLK has been sent?Should We use SPI_DMATransmitReceiveCplt?
Fairly basic question; When working with CubeMX, I want to set up ADC1 and ADC2 to trigger and sample at the same time, using an HRtimer trigger pulse, at about 5 MSPS. ADC1 is sampling channel 1, and ADC2 is sampling channel 4.I have them working right now, using two separate DMA channels. I want to try and improve this, and use only one channel. They NEED to sample at the same exact point in time, but I'm a little confused by this option in Cubemx. which implies that there will be an inherent delay between the two ADCs sampling... But, reading the reference manual, there's no mention of a delay unless you're using an interleaved mode or alternate trigger mode.Is what I'm wanting not possible to do with dual regular simultaneous mode? Or is this a bug or not actually relevant to the dual simultaneous sample mode?Thank you.
Please tell me how to add HID to STM32 USB-Audio to enable Next Track etc.
Hello ST community,I have a question regarding the HID functionality of an STM32 controller.I have realised a (driverless!) joystick with an STM32 controller. So far everything works fine.However, I would like to write additional PC software that can set some properties of my joystick from the PC side. For example, I would like to trigger a calibration of my axes or set the axis sensitivity or define the LED lighting (static!) of my joystick.Do you have any tips on the best way to do this?My thoughts:- Custom HID class ?Should I create a custom HID class with my own commands?I had already found a good tutorial here on the ST site, but a type of communication for microcontroller-side calibration or communication with the controller for exchanging settings & data seems to be different?. This method would not make sense for a standard joystick? [As far as I understand it]- Serial USB connection ? (USB-CDC?)Since the microcontroller can also be used for serial communication via U
There are some errors in SVD when it comes to reset values. I'm basing my judgement as I am comparing SVD with RM0492: RCC_AHB1ENR SVD: 0xd0000100 RM:0x90000100 (BKPRAMEN set in SVD)RCC_AHB2ENR SVD:0xc0000000 RM:0x40000000 (resered bits b31 set in SVD) Some random values for sleep clock registers, while all of them shall be 0xFFFFFFFFRCC_AHB1LPENR 0xf13ad103RCC_AHB2LPENR 0xc01f1dffRCC_APB1LLPENR 0xdffec9ffRCC_APB1HLPENR 0x4080022bRCC_APB2LPENR 0x17f7800RCC_APB3LPENR 0x30fa42
ADC_CFGR register and EXTSEL field.In SVD this single field is split among four 1-bit long ones (according to RM0492) and enumerated values desciptions are messed up (adc_ext_trg0 & adc_ext_trg1 repeated for all 4 "subfields")RM0492 discusses this as single field, which is correct, i.e."Bits 9:5 EXTSEL[4:0]: External trigger selection for regular groupThese bits select the external event used to trigger the start of conversion of a regular group:00000: adc_ext_trg000001: adc_ext_trg100010: adc_ext_trg200011: adc_ext_trg300100: adc_ext_trg400101: adc_ext_trg500110: adc_ext_trg600111: adc_ext_trg7...11111: adc_ext_trg31"etc...In the same time ADC_JSQR_JEXTSEL is defined as single 5-bit long field.Bits 6:2 JEXTSEL[4:0]: External Trigger Selection for injected groupLogical inconsistecy...Is SVD created from RM or vice versa?Either way I think RM0492 (page 579), SVD and stm32h503xx.h files shall be corrected, to have both descriptions, i.e. EXTSEL & JEXTSEL aligned.
(1) TIM1_SMCR and TIM2/3_SMCR have different naming convetions for SMS / TS fieldsi.e. for TIM1_SMCR there are SMS/SMS_1 and TS/TS_1 and for TIM2/3_SMCR, SMS1/SMS2 and TS1/TS2 respectively.(2) Also TIM1_SMCR_TS_1 field has no enumerated values, while for TIM2/3_SMCR_TS2 there are, but wrongly described. TIM1_SMCR_TS & TIM2/3_SMCR_TS1 has enums for the range 0..7 only, ie. the TS1 field itself.As described in the RM0492, those fields must be combined.I think the easies way forward would be to provide enums only for the TS1 field, and add missing values:B_0x10000:Internal Trigger 4 (tim_itr4)B_0x10001:Internal Trigger 5 (tim_itr5)B_0x10002:Internal Trigger 6 (tim_itr6)B_0x10003:Internal Trigger 7 (tim_itr7)B_0x10004:Internal Trigger 8 (tim_itr8)B_0x10005:Internal Trigger 9 (tim_itr9)B_0x10006:Internal Trigger 10 (tim_itr10)B_0x10007: Internal trigger 11 (tim_itr11)B_0x20000: Internal trigger 12 (tim_itr12)B_0x20001: Internal trigger 13 (tim_itr13)B_0x20002: Internal trigger 14 (tim_i
HelloWe are using the Nucleo-f439zi (STM32F439ZITbu microcontroller) https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdfWe have set up the Nucleo in device mode for USB_OTG_FS, we are able to receive setup packets through the FIFO and read them but when we try to reply to the Device Descriptor request, even though it seems like everything is correct (size to send out packet is 0x12, pointer to the 0x50001000 FIFO address and simplest device descriptor matrix, even though XFRC bit in DIEPINT0 gets set to signal the transfer complete.The order of events is :The device gets physically connected to the hostHost sends setup packetThe device reads the FIFO and stores the setup packet.when setup phase is done (DOEPINT_STUP interrupt triggered) the device reads the setup packet and checks to see if it is a Device Descriptor Request (DDR), which it is.If it is a DDR
I am trying to prototype ethernet on the NUCLEO-H7S3L8 eval board. When enabling ethernet through CubeMx using the same configuration I've used on the NUCLEO-H563ZI, the ethernet driver fails initialization. Is there an alternative Ethernet driver that is recommended or a better eval board I should use?
Good morning everyone,I'm here to ask for advice regarding the approach I want to take for enabling firmware updates by non-expert users.I have built hardware that uses the STM32F103, and over time I will certainly release updates. Currently, I'm using a serial interface for uploads, but I would like to simplify the process further (avoiding the need to move the BOOT0 switch to + or use USB-UART converter chips).I'm studying the DFU upload method and have tried various bootloaders. I found one called dapboot, which is quite appealing because when you connect the USB, it opens the DFU web interface to upload the firmware directly.GitHub repository for dapbootDFU web interfaceThe problem is that I can't integrate it with my sketch written using PlatformIO and the Arduino framework.I want my program sketch to trigger the dapboot bootloader using a specific button combination. If this combination is not pressed, the program should run the main applic
Hi,The requirement is to port MQTT of NetX Duo to STM32f412 ,without the need to use the TCP/IP and TLS addons in NetX Duo. Since we have DIGI XBee's modem and we will use its TLS socket for communications. I have the secure-socket-like interface ready, e.g. createSocket, connect, send, recv, etc...I'm looking at the middleware at stm32-mw-netx. At the beginning, I expected by providing my own BSD addon, I could run the azure-iot. But it turns out that the BSD addon in that repository is not used by MQTT. Can you suggest how I can integrate my sockets to the azure-iot/MQTT addon? Best regards,Hongwei
HELLO,I am working with the LwIP MQTT client(stm32f407) and trying to connect securely to Azure IoT Hub using port 8883. I have enabled secure TLS connections by defining LWIP_ALTCP and LWIP_ALTCP_TLS. However, I am facing a connection reset issuemqtt_parse_incoming: Remaining length after fixed header: 3 mqtt_parse_incoming: msg_idx: 5, cpy_len: 3, remaining 0 mqtt_tcp_err_cb: TCP error callback: error -15, arg: 0x20004d2c MQTT: mqtt_connection_cb: Disconnected, reason: 256code snippet: #define MQTT_HOST_IP "13.xx.74.xxx" #define MQTT_HOST_PORT 8883 #define MQTT_USERNAME "xxxxxetestnewhub.azxxxxxxxx/config_test_99/?api-version=2021-04-12" // If required #define MQTT_PASSWORD "SharedAccessSignature sr=xxxxtestnewhub.azure-devices.net%2Fdevices%2Fconfig_test_99&sig=SawDwVxxxxxxxxxxxxGUHDtuqxaiE%3D&se=1734452908" // If required const char azure_root_ca[] = "-----BEGIN CERTIFICATE-----\r\n" "MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh\r\n" ,,,,,,
I made a project on keil with generate flm file to download to external flash with my board. My board has a stm32h7b0zbt6 chip with ospi interface with a spi nor flash W25Q128. the interface releate is: PF6 ------> OCTOSPIM_P1_IO3 PF7 ------> OCTOSPIM_P1_IO2 PF9 ------> OCTOSPIM_P1_IO1 PB2 ------> OCTOSPIM_P1_CLK PD11 ------> OCTOSPIM_P1_IO0 PC11 ------> OCTOSPIM_P1_NCS and I append the project , is there anyone can help me to check the project ? When I try to use this flm file to download code on keil, I get errors like below:
Split from: https://community.st.com/t5/stm32-mcus-embedded-software/hardfault-udp-client/m-p/716640I have the same problem. @LEAMtw, I hope you don't mind if I add details here for my scenarios.Error Thread #1 [main] 1 [core: 0] (Suspended : Signal : SIGTRAP:Trace/breakpoint trap) MemManage_Handler() at stm32h7xx_it.c:105 0x8016138 <signal handler called>() at 0xffffffe9 ethernet_input() at ethernet.c:113 0x802e6c4 ethernetif_input() at ethernetif.c:347 0x8023e18 MX_LWIP_Process() at lwip.c:156 0x8023b6a Firmware::MainRuntimeLoop() at firmware.cc:101 0x80034de Boilerplate_Loop() at boilerplate.cc:16 0x80011d6 main() at main.c:131 0x8015458 When debugging, I noticed that `p` buffer is valid, however, the payload is invalid. Name : p Details:0x30004140 <memp_memory_RX_POOL_base+15680> Default:0x30004140 <memp_memory_RX_POOL_base+15680> Decimal:805323072 Hex:0x30004140 Binary:110000000000000100000101000000 Octal:06000
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.