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 using STM32F107RB MCU for my custom project, currently testing ethernet section. No ping is working and I don't see any data in wireshark.The Firmware package version is 1.7.0 and IDE version is 1.15.3.Could anyone suggest.Regards,NaveenK
hI! I am using the LPTIM, but not work in 486us, the minimum value is 2.6ms. in the logic analyzer i view:
I am studying the SMBUS stack code to understand how it works. My system has a smart battery. The battery periodically emits two messages intended for the charger (charging voltage and charging current). My software is the host. Sending commands to the battery is working just fine. As an exercise I am trying to receive the two charger messages. Following (more or less) the ST code I do this:- Set own address to the expected charger address- Call HAL_SMBUS_EnableListen_IT()- enables ADDR interrupt, I guess- On ADDR interrupt, AddrCallback is called- Call HAL_SMBUS_Slave_Receive_IT() to receive one byte (the command ID)- On completion, SlaveRxCpltCallback() is called- Call HAL_SMBUS_Slave_Receive_IT() to receive remaining bytes of the command- On completion, SlaveRxCpltCallback() is called a second time- Call HAL_SMBUS_EnableListen_IT() to set up for the next commandThis apparently works perfectly for the first command. I get the ADDR interrupt, the command byte and the data bytes, and I
I am developing an TCP/IP Server Client application on my NUCLEO-F207ZG development board.I am implementing a function to send ADC values on Ethernet.void Client_Data_Send(void){char temp_buff[TEMP_BUFF_SIZE];volatile uint32_t buff_len;volatile uint16_t Temperature = 0;struct pbuf *p = NULL;Temperature = TEMP;buff_len = sprintf(temp_buff,"DHT11 Sensor value from TCP Client : %u \n\r",Temperature);/*allocate pbuf from ram*/p = (pbuf_alloc(PBUF_TRANSPORT,buff_len,PBUF_POOL));(tcp_client->p)= (p);if(tcp_client->p != NULL){/*copy the data to send into the allocated pbuf*/pbuf_take( tcp_client->p ,(char *)temp_buff,buff_len);/*send data*/tcp_client_send(tx_pcb, tcp_client);/*free mem*/pbuf_free( tcp_client->p);}}Above is the function I implemented.At line (tcp_client->p)= (p); when I debuged I came to know that values are not getting assinged.Below are the screen shot. since wrong values for all members getting assigned I am facing Hard fault issue. Is it str
Hello,I'm trying to generate continous stream of random bits on SPI MOSI (for eye pattern analysis).I'm making tests with 2 byte sequences.I'm starting DMA transfer with : HAL_SPI_Transmit_DMA(&hspi2, &spi_outdata, 2); in the HAL_SPI_TxCpltCallback I start another SPI transfer. I notice few tenths (cca. 60) of microseconds gaps on clock and data signals on SPI MOSI output.Is there any way to achieve continuous clock and data signals on SPI ?If I try to send on Half Callback, DMA is busy - it doesn't send. Can I somehow only add to output buffer on half-complete callback or any other solution? Thanks in advance,regards.
I am using SMBus to communicate with a smart battery. After looking at the code, I decided against using the SMBUS middleware but to directly using the HAL_SMBUS_xxx calls. My STM32G491 is the host and sending read-word commands to the battery works just fine. The bit I'm confused about how to receive commands emitted by the battery itself.I can see that the battery periodically emits a byte. The value is 0x12 and is by default NACKed. If I treat this value as the host's node address (i.e. 7-bit address 0x09) and set OwnAddress1 to 0x12, the byte is ACKed and another byte (0x14) appears on the bus about 25ms later, which is NACKed. There is another similar exchange about a second later. The error callback is called, apparently because of a timeout. The bus is now stuck in the state HAL_SMBUS_STATE_MASTER_BUSY_TX and I don't know how I'm supposed to clear this. Now sending further read-words commands fail because the bus is "busy".I'm still looking into this but would appreciate any ins
Hello, I have been working with the STM32U5 MCU and to start I worked through the workshop found here:STM32U5 Workshop (rristm.github.io) As part of the workshop the USART1 is setup in continuous communication mode. Is it possible to setup SPI in a similar way for continuous communication? Thanks,UL
Hello, I have been using the STM32F4 chip for a while but I ran into an issue when trying to communicate with an ADC to sample at 200kHz. So I have started to work with the STM32U5 chip. My goal is to use the SPI RDY feature or the GPDMA triggered from an external interrupt in order to handle the spi communication and fill a buffer. Unfortunately I have been struggling to find good resources on how to use these features or examples that I can try to follow through. I am able to do spi communication that are called from the main process but I can't get a message to trigger from an external interrupt. Any advice on how I can learn about these features would be greatly appreciated, I have also included the code as I have it thus far. Thanks!
Hello experts,I am trying to do basic write and read of internal flash. For that I have taken fixed pattern of data to write.I am using the driver functions to do this job but when I observe the data in the memory browser the same pattern which iam trying to write is not reflecting. I am attaching my code below please let me know if missing anything. int main(void){/* USER CODE BEGIN 1 */ /* USER CODE END 1 *//* USER CODE BEGIN Boot_Mode_Sequence_0 */int32_t timeout;/* USER CODE END Boot_Mode_Sequence_0 */ /* USER CODE BEGIN Boot_Mode_Sequence_1 *//* Wait until CPU2 boots and enters in stop mode or timeout*/timeout = 0xFFFF;// while((__HAL_RCC_GET_FLAG(RCC_FLAG_D2CKRDY) != RESET) && (timeout-- > 0));// if ( timeout < 0 )// {// Error_Handler();// }/* USER CODE END Boot_Mode_Sequence_1 *//* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick.
I AM USING IN USB_HS DEVICE MODE ,WHEN I CONNECT USB CABLE TO THE PC THEN I WANT TO KNOWE WHERE IT IS DETECT AND AFTER THAT I REMOVE USB CABLE THEN WHRE IT IS DETECT GIVE ME ANY REGISTER OR CALL BACK FUNCTION ONLY TELL ME IN DEVICE MODE
Hello everyone, i am working on a software for setting the date and time. The plan is to set the date and tame manually (so no defficulties regarding that) and then continue to increase within the time flies thanks to the RTC of the NUCLEO F401RE. Do you think that would be possible ? Would it be a simple way to set the date and time, by directly using the RTC with HAL libraries for example ? Im thanking you already for your answers, XOXO
Hi Team,I have STM32L562 EDK with me , and can i make a USB PD application with that alone ?, or should i buy x-nucleo-snk1m1 which has TCPP01 for port protection?Expecting a quick replyThanks in advanceNithin
The way LL_EXTI_Init is written in all of the cube APIs means if you do this: LL_EXTI_InitTypeDef exti_config = { .Line_0_31 = foo, .LineCommand = ENABLE, .Mode = LL_EXTI_MODE_IT, .Trigger = LL_EXTI_TRIGGER_NONE, }; LL_EXTI_Init(&exti_config); The LL_EXTI_Init function will take no action, but will return SUCCESS.This is a problem if the EXTI trigger mode was previously set to something other than LL_EXTI_TRIGGER_NONE, because the EXTI trigger will left enabled, with no clear error.Granted of course I can just change my code to set the LineCommand to DISABLE instead to remove the trigger, but it seems a bit counter-intuitive that LL_EXTI_TRIGGER_NONE doesn't clear the triggers.It would be useful if LL_EXTI_TRIGGER_NONE was added to the case statement: case LL_EXTI_TRIGGER_RISING_FALLING: LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31); LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31); break; case LL_EXTI_TRIGG
#include <stdio.h> #include <string.h> #include "fatfs.h" #include "fatfs_sd.h" #include "main.h" FATFS fs; FIL fil; FATFS* pfs; DWORD fre_clust; uint32_t totalSpace, freeSpace; /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ char buffer[100]; /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ SPI_HandleTypeDef hspi1; /* USER CODE BEGIN PV */ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ void SystemCl
Hello, I am new to the stm32 world.I'm trying to use my stm32f103c8t6 board as an intermediary to enable communication between the computer and arduino.The project is simply based on receiving a message from the computer, and the STM32 sending a different message package to Arduino according to the incoming message.That is, receive and transmit operations must occur simultaneously.For this, at first I was receiving data via USB CDC and transmitting data via UART and I was successful. But for reasons beyond my control, I need to use a communication method other than USB-CDC.Even though I tried to use uart for data exchange, I was not successful, there is an example code I shared at the image (pink ones are message I sent, black ones message I get) I would appreciate it if you could tell me the changes I should make for this process or the protocols you recommend me to use.
Sorry, Google Translate changed my previous post to Polish. That's probably why no one answered me.Now the post is correct. I'm creating a custom board using a used STM32H563VIT. Nice processor, but I can't understand how to create an Audo class, even if it's BT 1.0.In the F series of processors, e.g. STM32F720, it was simple, but here it is somehow mixed up. USB parts diagram: I am trying to use a USB Adio class device.For this reason, there is no AZURE RTOS in the IDE (H5).I have configured the USB I configured USBX as FS_Device I took the stack sizeAfter my changes The device is in working order HAL_PCD_STATE_READY UINT MX_USBX_Device_Init(VOID){UINT ret = UX_SUCCESS;...UX_PARAMETER_NOT_USED(ux_device_byte_pool_buffer);...return ret;}However, the system does not detect the device.What else should I do for the system to detect the device?
Hello,I have a problem with my microcontroller (stm32f407VGT). The microcontroller runs correctly in our application for 30 minutes or 5 minutes (times are always different until the error occurs). Then suddenly the peripherals no longer work, e.g. no CAN messages are sent or received, all I2C and SPI buses do not read in correctly, GPIO outputs no longer switch HIGH (e.g.: LED turns on briefly for 300ms and then goes off, even though the LED should stay on for 1 second.I have already debugged and the microcontroller continues to run normally. There is no hard fault, otherwise the system timer also continues to run normally. I suspect it's not an EMC problem, since the problem doesn't occur periodically in our application.Does anyone have a suggestion on how I can fix the problem so that the microcontroller runs reliably.
Hello,I am currently engaged in an IoT project utilizing the STM32H5 microcontroller unit (MCU). I would like to inquire whether the X-CUBE-CELLULAR library is available for the STM32H5 MCU. If it is not currently available, are there any plans to port the X-CUBE-CELLULAR library to the STM32H5 MCU in the future?Best regards,
My setting is a Nucleo F767ZI board with a IKS01A2 shield. I created a FreeRTOS project that periodically queries the temperature sensor, calculates an average of temperature data, and prints the temperature on the UART. It has three threads that work as follows:- The first thread performs a HAL_I2C_Mem_Read_DMA to read temperature from the sensor on the shield, stops on a FreeRTOS event (that is fired by the DMA completion callback), then acquires mutex A, puts the temperature data in a shared circular buffer, releases A, and then sleeps (period: 100 ms).- The second thread acquires mutex A, calculates the average of the temperatures stored in the shared circular buffer, releases A, then acquires mutex B, puts the average in a shared variable, releases B, and then sleeps (period: 500 ms).- The third thread acquires mutex B, reads the shared variable with the average temperature, releases B, prints on the UART and then sleeps (period: 1000 ms).The application fails in few seconds with
Hello, I am trying to calculate the internal CPU temperature on an STM32H743, When reading the internal CPU temperature sensor using ADC3 IN18 (internal temperature), I get a very high value (~731C)The formula I'm using is the following :Temperature (in °C) = (110 °C – 30 °C) / (TS_CAL2 – TS_CAL1) * (TS_DATA – TS_CAL1) + 30 °CHere is the algorithm to read the temp :Initialise ADC3 Calibrate ADC3ADC3 Start DMA "Reading ADC3 values via DMA, Temperature sensor values are inside ADC_CHANNEL_TEMPSENSOR rank 11"Start TIM6 (PSC = 10, ARR=59999) for the sampling frequency of the ADC3, and the samplingTime is 810.5Calculate TS_CAL1, TS_CAL2 Convert ADC value to C°Here is the code :MX_ADC3_Init();HAL_ADCEx_Calibration_Start(&hadc3,ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED);HAL_ADC_Start_DMA(&hadc3, (uint32_t *)&DMABuff[0], 11);HAL_TIM_Base_Start_IT(&htim6);const uint16_t* ADC_TEMP_3V3_30C = (uint16_t*)(0x1FF1E820);const
Hello everybody,I bought a STM32G431RB Nucleo. I created code for it with the STM32 CubeMX and modiefied the code in the STM32 CubeIDE. I want to access "HAL_TIM_PeriodElapsedCallback" and "HAL_TIM_PWM_PulseFinishedCallback", I read that this is possible by calling "HAL_TIM_Base_Start_IT" for "HAL_TIM_PeriodElapsedCallback" and "HAL_TIM_PWM_Start_IT" for "HAL_TIM_PWM_PulseFinishedCallback". But when I do that, the STM32 seems to crash. Am I doing something wrong, or is this simply not possible?Thank you in advance!int main(void) { /* USER CODE BEGIN 1 */ /* 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 */ /* In
Hello,I have a problem with the bootloader on a Nucleo G071RB. I have no problem reaching the bootloader to download some new firmware in UART, after a reset and Boot0 pin set as it should, the bootloader responds to messages send through UART : when sending the begin command it is acked, same for the command to get version and read protection status and the readout unprotect command too. The problem is, after sending this last one, it simply stops responding after sending the two ACKs of the readout unprotect command. I've tried with the begin command and the write unprotect command, it doesn't answer, there's no ACK or NACK, it just sends nothing.It is also worth mentioning that the firmware that was present on the Nucleo board isn't erased as it continues to run after a reset in normal execution mode.I have logged the response of the get version and read protection status and I have the following result which seems a bit odd : 0x79 0x31 0x00 0x00 0x79. So I have the two ACKS, the ve
Hi, i'm trying to use execution profile kit in threadx. I use STM32H750VBT6 and STM32CubeIDE1.12.0firstly, i use stm32cubemx to generate the code include threadx. I can't find execution profile file in the code. So I get tx_execution_profile.h and tx_execution_profile.c from the rtos threadx in github. And I put them in Middlewares\ST\threadx\common\inc and src.Secondly, I define TX_EXECUTION_PROFILE_ENABLE in tx_user.h, init DWT and use _tx_execution_initialize(). In the end, I try to use _tx_execution_thread_time_get() to get time. Unfortunately, I alway get 0. I debug the project and find that the problem is in tx_thread_schedule.S . It seems that the program did not run under this condition: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) even if I already define TX_EXECUTION_PROFILE_ENABLE in tx_user.h. That makes me confused. because the .S includes tx_user.h .However, I dire
I followed this article by @Khouloud GARSI and was unable to get the function to jump to the bootloader working. The application seems to freeze after I execute the function given in the article and the bootloader doesn't ACK my messages until I reset the MCU with BOOT0 line pulled high (so I know I can talk to the bootloader in principle - I just can't jump to it programmatically).Also, I don't understand the claim in that article that the bootloader starts at address 0x1FF09800 when the documentation says it starts at 0x1FFF0000 (see AN2606). In any case, I tried jumping to 0x1FFF0000 and got a hardfault, so 0x1FFF0000 seems like the wrong address.We're trying to automate the process of firmware updates where we have an external control board talking to the STM32H745 MCU and allowing us to do OTA firmware updates, but the BOOT0 line is not connected to the control board. We built a custom board that we don't want to change, so if we have to toggle the BOOT0 line programmaticall
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.