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'm facing difficulties bootloading or upgrading firmware on an STM32F405 MCU from an SD card.Could anyone recommend a library or resource for achieving this? I've already tried a few methods but haven't had any success. Any help would be greatly appreciated.
Hello, I am new to STM world. I am trying to make an array of GPIO pin in this format {{PIN1_GPIO_PORT, PIN1_PIN}..... This would then be used in custom function so I can dynamically access this pins. How should I declare such array and how would i use them with HAL_GPIO_WRITEPIN function. Main use of this is to select SPI slave to communicate with. Thanks in advance
I am using the STM32U5A9J-DK for a UART communication test, and I expect to display the content sent from the computer's Serial port on the screen (textArea).I'm using UART1, 115200 Baud rate, 8 data bits, 1 stop bits, and I've turned on the UART interrupt, but for some reason the text on the screen doesn't change.There are not many examples that I can find, so I hope someone can help me to clear this up!Here is my code
I got this assembly code (see below) in an ST example code on secure boot and and I don't understand some lines :why do we have to push R1 five times in a row?why is LR set to 0xFFFFFFF9? That is causing a hard fault at runDoes anyone have better understanding? 1 .global launch_application2 aunch_application:3 /******************************************************4 * return from exception to application launch function5 * R0: application vector address6 * R1: exit function address7 * push interrupt context R0 R1 R2 R3 R12 LR PC xPSR8 *******************************************************/9 MOV R2, #0x01000000 /* xPSR activate Thumb bit */10 PUSH {R2}11 MOV R2, #112 BIC R1, R1, R2 /* clear least significant bit of exit function */13 PUSH {R1} /* return address = application entry point */14 MOV R1, #0 /*
Hi, I would like to, trigger an update event interrupt using software. My timer runs in One Pulse mode, the idea is, that another event should also run the code in my Timer ISR. So after this other event happens in my code, I don't want to wait for the timer, I simply want to trigger the ISR through software, Reset the counter and then stop the counter (this is automatic in One Pulse Mode). I have tried setting the Update Event Bit in the Event Generation register, without any luck. Thanks
I'm working on the STM32H747I-DISCO board. While trying out how the recording works on the board, I downloaded and built the latest version 1.11.0 from: https://www.st.com/en/embedded-software/stm32cubeh7.htmlSpecifically, the code in: .\STM32Cube_FW_H7_V1.11.0\Projects\STM32H747I-DISCO\Examples\BSP\STM32CubeIDEI saw that there's a line mentioned "Make sure the SW2 is in position PDM". I wonder what that means, specifically, what does SW2 mean here. (I cannot find it in RM0399 nor UM2411)Thank you.
Hi,I'm facing problem in reading data from EEPROM, which was written before power cycle.EE_Init() always causes formatting of EEPROM irrespective of EE_CONDITIONAL_ERASE or EE_FORCED_ERASE parameter passed, resulting in erasing the previous dataConfiguration: "STM32H5 series using high-cycle data area" with EDATA_ENABLED & START_PAGE_ADDRESS 0x0900C000UI'm using the latest version of EEPROM emulation driver "X-CUBE-EEPROM version-6.0.0" on dev kit "NUCLEO-H563ZI"The example code works fine, it is able to write and read the data from the flash every time on power up by formatting the page, but when I wanted to read the data which was written in previous cycle, It always reads data zero.The reason I found was, it always give current page status as "ERASING".I made the following change in function FindPage(), having a switch case operation for "FIND_READ_PAGE" by adding a check currentpagestatus == STATE_PAGE_VALID as shown below.I added STATE_PAGE_VALID check instead of STATE_PAGE_ER
I have implemented a basic I2C between STM32H7 (Main) and STM32F4 (Secondary) processor. I am using an array of size 6 to transmit from the Main CPU to Secondary CPU using I2C in IT mode.The HAL API for I2C requires the data_buffers to be of size uint8_t, but the HAL APIs also accept data_buffers of size uint32_t if they are typecasted to uint8_t. The next parameter for the data buffer size should be unt16_t for which I have implemented them as: size(txData)/sizeof(txData[0]) and the same implementation for the rxDataBuff on the receiving end.The HAL APIs that I am using are:1.] On the Main CPU:HAL_I2C_Master_Seq_Transmit_IT(&hi2c1, SlaveAddress << 1, TxDataFrame, Size_TxD, I2C_FIRST_AND_LAST_FRAME);2.] On the Secondary CPU:HAL_I2C_Slave_Seq_Receive_IT(&hi2c1,rx_dataFrame, rxDataFrame_Size,I2C_FIRST_FRAME);What I noticed is, if I initialize my "TxDataFrame" and "rx_dataFrame" as an array of 'uin8_t', then the HAL APIs for I2C are able to successfully transmit and rec
This is probably a *** question, but I was wondering if there is a difference in performance between the following C statements given b is a standard boolean:bool b = false; //... if (b == false) //... if (!b) //...Will gcc in STM32 Cube IDE translate these to the same number of instructions? It seems the second statement would require two operations: first to negate, then to check for inequality to zero, unless the compiler knew how to optimize this. I ask because I see a lot of the first form in the HAL and LL library code, but the second form to me is simpler and quicker. I had trouble finding the answer online, as this normally would be trivial, although I could see it being something to consider at a very slow clock or in a loop. Is there an easy way to see the C code side-by-side with the assembler in cube IDE?
Hi all,I am currently working on GSM 4G module with STM32F429ZI. We are trying to connect to our server using LwIP and PPPos. I am able to connect to PPP and get PPPERR_NONE and IP address. I am also able to connect to our server using socket connection. Our module communicates with our server very nicely for some time. But after sometime, I am unable to connect to socket and I get errno 103 (and 105 sometimes). But the PPP still seems to be connected as I am not getting any PPPERR_CONNECT or any other error message in the callback. There is also no example related to PPP in STM32 CubeMX. There are hardly any PPPos LwIP using STM32-related examples on the web.Does any one have an example of PPPos using LwIP in STM32 and doing stable socket connection ?Regards,GBhat
Hello,I am working with timers in a stm32 project. In the generic INIT function that is generated using the .ioc file important functions like HAL_PWM_Init(), HAL_TIMEx_MasterConfigSynchronization() etc are understandably called outside the user code sections. Now, I want to customize the init function so that I can use variables for prescaler, period etc. For that I need to add user code and call functions like PWM_init and ConfigSync again after they are already called(?) Wouldn't that be inefficient? Alternatively, if I remove the code outside the user code section or completely remove the function itself it will reappear once I generate code after making some changes to the .ioc file. I can make custom init functions but the init functions will still remain in the code. I know I can stop using the generate code functionality but is there some way around it where I can have my cake and eat it too? Modify code outside the user code sections and it not be overwri
I am working with STM32G474RET6U MCU and I would like to check the values of bit filed EXTSEL (ADCx->CFGR.EXTSEL) the problem is that according to SFR view this bit field starts on 6th bit of CFR register, but according to the reference manual it should start on the 5th bit. Is this a mistake of STM or am I missing something?
Hello.I'm using the STM32U5A9J-DK development board to work on a project to display UART data on the screen textArea, and I've made sure that there are no problems with the communication between the PC and the STM32 UART, and with the process of Model-Presender-View displaying the data on the screen. program flow:UART signal from PC -> main.c program receives it and saves it to CMSIS queue, get the content of queue from Model.cpp -> pass string through ModelListener. Here is my code:main.c char RxData[257]; // received data from UART char Data[257]; // copy from RxData void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size) { RxData[Size] = '\0'; strncpy(Data, RxData, Size+1); if (osMessageQueueGetSpace(uartQueueHandle)>0) { osMessageQueuePut(uartQueueHandle, Data, 0 ,0); HAL_UART_Transmit(&huart1, (Data), Size+1, 10); // print Data array } HAL_UARTEx_ReceiveToIdle_IT(&huart1, RxData, 256); } After "Data" is put into t
i use STM32F107+LWIP(2.0.3)+freeRTOSI wrote the program with the help of the following document :https://www.st.com/resource/en/user_manual/um1713-developing-applications-on-stm32cube-with-lwip-tcpip-stack-stmicroelectronics.pdfAfter connecting the computer with the micro a few times, the information is correctly received by the micro.But I don't send a reply to the computer. The tcp_server_recv callback function only turns one LED on and off for one second.After sending information a few times, it stops receiving and I don't have ping anymore.What advice can you give?
Hello STM community,I'm working on a project where I need to inject pre-configured config.ini and cacert.pem files into my STM32 target for mbedlts communication. I've gone through the STM32CubeU5 example for FileX, which demonstrates creating a file at runtime.However, I'm unsure how to modify this example to include code that reads these configuration files from storage internal flash and then perform the necessary operations with them.Could anyone provide guidance or share an example of how to achieve this using FileX on STM32?https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/B-U585I-IOT02A/Applications/FileX Thank you in advance for your help!Best regards,
I am using the STM32H753 ARM Cortex M7 processor(Package LQFP208).My SYSCLK runs at the max. speed of 480 MHz and I want to configure my I2C1 (polling) in the Fast Mode (400KHz). I have configured the GPIOs and the modes but I am stuck at the "I2C_TIMINGR". I went through the I2C_TIMINGR register configuration examples on Pg. 1982 - 1984 of the reference sheet for the H753 but I wasn't able to figure out how to use those values. As my aim is to configure the I2C in the fast mode, how and which register should I use to set it at 400 KHz speed and accordingly what values to be loaded in the Prescaler, SCLL, SCLH? The examples provided in the reference sheet are for configuring I2C @ 8MHz, 16MHz and 40MHz. I will kindly need someone's assistance on the same. Please correct me if I am wrong with my understanding here. Also, I am new to programming so I would kindly appreciate if someone could explain this configuration part in detail for me. PS: I can use the
My OTG_HS2 kernel clock is PLL3Q at 48 MHz. If I use CSleep (only CSleep, not any of the deep sleep modes), SOFs are generated at the wrong interval (checked with protocol analyzer and oscilloscope). If I remove the WFI, SOFs are generated at the proper interval. It seems that either CSleep is gating the USB clock or else it is turning off PLL3, neither of which it should do. Has anyone else seen this?
I am not a hardware tech, but am familiar with some bit-fiddly work in software. Still, I am new to modern firmware development, and could likely use a pointing finger.I've been tasked to write firmware with these two components.The board is built, and I have a schematic for it.Using STM32CubeIDE, I've connected the pins according to what I see in the schematic.I also set up LWIP and FreeRTOS, in an effort to reduce much of the bit twiddling down to a more familiar environment for myself... again, using the STM32CubeIDE Pinout and Configuration tool. I enabled DHCP, to get this to fetch its own IP address, but that's about it. If it helps, I'm using version 1.14.1 of STM32CubeIDE.As mentioned in the subject header, the MCU is an STM32F107VC chip, and the ethernet component is actually a 3-port switch (the KSZ8863FLL). I can control this over an MII interface.I also have an STLink/V2 programmer-debugger, which allows me to step in the code... a rather valuable fe
hi all, i am using STM32U585 controller which is having a internal UCPD controller.my requirement is to create a module which can act as host and device using USB type C. i am taking the hardware connection as same as stm32U585 eval board(and adding a external crystal for the host part) since it is supporting both host as well as peripheral role. is there any specific code or documents available for the USB DRD/OTG implementation using TYPE C. all i can find the independent host and peripheral examples from ST. my actual requirement is : host: USB MSC when the module connected with flash drive it will work as mass storage (source the power) device: USB CDC ACM when module connected with the PC it is work as VCP terminal and (sink the power) I implemented the code for host and device code independently , the problem is where we changing the roles and power delivery. I am planning to implement the same schematic as in B-U585I-IOT02A which is using a exter
Affected driver library: STM32Cube_FW_U5_V1.2.0File: stm32u585xx.hThe definition of CRS_CR_TRIM_Msk is wrong.Currently it is:#define CRS_CR_TRIM_Msk (0x3FUL << CRS_CR_TRIM_Pos) /*!< 0x00003F00 */But instead it should be:#define CRS_CR_TRIM_Msk (0x7FUL << CRS_CR_TRIM_Pos) /*!< 0x00007F00 */(The TRIM field has seven bits, not six)
Hi - can anyone tell me how to insert a CORS header into LWIP?(Cross-Origin Resource Sharing) header directly into the httpd.c? file of LwIP)i.e.Access-Control-Allow-Origin: *I am using vscode to debug an index.shtml file file, but i need to get responses from my H743 webserver to be able to debug fully.Any ideas?ThanksChris
Hi, Good morning, everyone. I'm new to IOT. So, I need your help for how to connect and use STM32L4S5VIT6 and AWS from the scratch. Could you please help me. Demo video or any sample code and share any related document for understanding purpose it is very helpful for us.
I am using STM32CubeIDE v1.13.2. When setting oversampling for ADC3 on STM32H723, the ratio value is incorrectly generated to exactly the number that is typed in the GUI: hadc3.Init.Oversampling.Ratio = 32; which is then on lines 725-735 in stm32h7xx_hal_adc.c written directly to the CFGR2 register: MODIFY_REG(hadc->Instance->CFGR2, ADC_CFGR2_OVSR | ADC_CFGR2_OVSS | ADC_CFGR2_TROVS | ADC_CFGR2_ROVSM, ADC_CFGR2_ROVSE | hadc->Init.Oversampling.Ratio | hadc->Init.Oversampling.RightBitShift | hadc->Init.Oversampling.TriggeredMode | hadc->Init.Oversampling.OversamplingStopReset ); however, for oversampling on ADC3, there is this mapping for the values:000: 2x001: 4x010: 8x011: 16x100: 32x101: 64x110: 128x111: 256xBy pure chance, this works correctly for values 2, 4 and 8 (as OVSR is offset by 2 in CFGR2). Higher values are of course broken.The generated value should probably be from the ADC_HAL_EC_OVS_RATIO. As this is different from ADC1 and ADC2
I'm trying to get a L452 to bring up a VCP under ThreadX/USBx, so I followed the instructions in:https://community.st.com/t5/stm32-mcus/how-to-implement-the-usb-device-cdc-vcom-in-stm32-using-the/tac-p/629402#M738It seemed pretty straight forward, it compiles, runs, creates the read and write threads, the main thread exits appropriately, but the USB device never enumerates on the bus.Just to make sure that my board works (Nucleo with a USB-B connector wired into PA11/12, ground, and +5), I can put the processor into bootload, it comes up as a USB BOOTLOADER, and I can use CubeProg to push code. So the physical connection is okay.I must be missing something. Is there something weird with the L4 that needs code tweaking? Can you please take a look?I've attached the project below.
I am using the STM32U575xx and found stackoverflow questions regarding the DWT->CYCLCNT.c - STM32 - How to enable DWT Cycle counter - Stack Overflow I tested this and it works fine, but I'd like to have documentation aside from the header file.I'd like to learn more about1. CoreDebug->DEMCR bits2. ITM->LAR
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.