Questions tagged [stm32]

1

votes
2

answer
158

Views

How do I reset the STM32 HAL UART driver (HAL) state?

I know one can enable a UART receive interrupt using HAL_UART_Receive_IT(&huart2, (uint8_t *)rx_buffer, expectedNumberOfBytes) But once started how does one stop it, 'manually'? We can disable the UART interrupt using HAL_NVIC_DisableIRQ() (ex: HAL_NVIC_DisableIRQ(USART1_IRQn)). This will prevent i...
clmno
1

votes
2

answer
1.2k

Views

STM32 F446RE simple DAC output; what am I missing?

Trying to get some simple DAC output before moving forward. Have a multimeter on the output A2 but this seems to never change from about 1V6 for whatever value I put into the DAC2 output function. #include 'stm32f4xx.h' #include 'stm32f4xx_dac.h' void io_config(void) { GPIO_InitTypeDef GPIO_InitStr...
user50619
1

votes
2

answer
77

Views

Newer version of GCC throws reinterpret_cast error

I am developing an embedded project (on STM32). I currently use GCC 4.9.2, but I would like to switch to newer version of my toolchain. Unfortunately my code which succesfully compiles on gcc 4.9.2, throws reinpreted_cast errors on version 6.2.0 or 7.2.0 and I have no idea why. It looks like that ne...
legier
1

votes
2

answer
175

Views

Programing STM32 like STM8(register level GPIO )

I programmed STM8 GPIO like PD_ODR_ODR4 = 1; but stm32f10x.h doesn't have this function.Is there any .h file that has definition for bits. Sorry but I don't know how to explain this problem better. I tried multiple GPIO libraries. strong text
jurgis1991
1

votes
2

answer
41

Views

Is there an autonimus realtime clock wilth month loss less than 10milliseconds?

Looking for a realtime clock for IoT project. Need a millisecond resolution for my app protocol and its loss is critical. So I wonder if there is an autonimus realtime clock (with a battery) that will loose less than 10ms per month and work for a year?
DuckQueen
1

votes
0

answer
55

Views

Trash in buffer when echoing a message from PC on Linux through a STM Nucleo board

I am working with STM NUCLEO board, managed to establish a connection between pc on Linux and a board on a serial port. From PC I send the following message: write( hSerial, 'check\n\r', 7 ); Starting the thread, that listens on the port and writes all the messages into terminal: void* thread2(void...
Kirill Kachinzskyj
1

votes
0

answer
1.8k

Views

How to build a stm32 with cmake

I want to build a stm32 project with cmake. The host is Linux ubuntu 4.4.0-98-generic. This is my CMakeLists.txt script file. I wrote this file refer to my Makefile. The Makefile works well. cmake_minimum_required (VERSION 3.5) set (CMAKE_SYSTEM_NAME Generic) set (CMAKE_SYSTEM_PROCESSOR arm) set (CM...
HoYa
1

votes
0

answer
46

Views

How to simultaneously play two PCM audio streams in one DMA

I am working on a project on the stm32f769i-disco board, which has to run a video game made by me. The graphical part is solved, where I have problems is when I need to play two or more wav files, I do not know which is the correct way to add them in a single stream. What is the algorithm that I mus...
Argonarh CIrith
1

votes
1

answer
261

Views

How to read Adafruit GPS Data with STM32?

I'm using a STM32 Nucleo-F334R8 board and a Ultimate GPS Breakout V3 from Adafruit. What I'm trying to do is to read the GPS data with Putty on my computer using the serial communication. At the end I want to get the GPS data on my F334R8 board and then send it to a RaspberryPi 3 with the serial c...
Adrien Laliere
1

votes
1

answer
602

Views

Using SEGGER SystemView with STM32

Currently I'm developing a project with FreeRTOS on a STM32L476VGT. Until now I've been debugging with Ozone(SEGGER) and J-Link (Edu and Ultra+) Now I would like to 'debug' or record system event using SystemView (SEGGER), but it's not working. first of all some of the configurations I think there a...
taquionbcn
1

votes
0

answer
228

Views

Updating bluetooth device name

I have a bluetooth blueNRG device on STM32 mcu firmware to which I'm programming. I want user to be able to change the name under which device is visible over bluetooth. The app sends new name to device, device stores it and upon next start when initializing bluetooth it sets it by updating the devi...
Vit
1

votes
0

answer
135

Views

STM32 I2C issue with max127

I am trying to read analog data from Max127 using stm32f4 discovery board. I seem to have setup the gpio pins and i2c correctly. But I seem to be getting a constant value from the i2c. It would be grea if I can find out my mistake, and I would appreciate any help. Here is the code snipped for enabli...
vnal1141
1

votes
1

answer
1.6k

Views

STM32 HAL_FLASH_Program not working as expected

I'm trying to program FLASH using HAL_FLASH_Program() function. Precisely speaking, I've written a function which is expected to write two measurements to flash at a set time interval (e.g. 3 seconds). However, when called, the function manages to write only the first one while ignoring the second...
aspdev
1

votes
0

answer
736

Views

How to get data from ADC with STM32F7

So I wanted to read out multiple channels from adc3 on my stm32f7 discovery. I have been able to read out one channel and set up for multiple ones, but I can't figure out how to read out per channel. I wanted to read them out by interrupt so I set the adc up like this: hadc3.Instance = ADC3...
vera
1

votes
1

answer
398

Views

STM32F103 Timer2 not interrupting

Background I'm relatively inexperienced with the STM32 series, so I'm sure that this is simple and I'm missing a setup somewhere. I am trying to set up the timer to simply interrupt on an update event, which should be when the counter rolls over at the TIM2->ARR value. I am currently setting a break...
slightlynybbled
1

votes
0

answer
463

Views

STM32 GPIO register level input

It's actually a basic code for controlling buzzer with leds. I did with HAL libraries.But the institution I was working with wanted to do this at the register level too. But I couldn't it. It's not too complicated however i don't understand where the problem is. My code in below. #include 'stm32f10x...
magnesian
1

votes
0

answer
143

Views

STM32F303VCT6 external interrupt with PA0 button won't toggle LED

I want to use a button connected to PA0 as an external interrupt to toggle LED on PE14 on button press. However calling the configure_PA0 function doesn't seem to work. I did a simple blinking instruction in while loop to test and it turns out when I call configure_PA0 the LED stays ON all the time....
Viral
1

votes
1

answer
215

Views

STM32L0+ PA0 PIN High

I am not sure, if this forum is right place to post such questions, but me as a beginner in STM32 facing the following problem. I have connected LED to PA0 pin in nucleo STM32L073RZ board. This is a main.c code, which I compile and flash board: #include “stm32l0xx_hal.h” int main(void){ volatil...
ussrback
1

votes
3

answer
561

Views

HAL_SetDate sets the year to wrong value

I'm using STM32F030RCT6 with CubeMX. Device is a datalogger and RTC is the main think that cannot fail. On Errata Sheet there is something about RTC Shadow Register. I configured CubeMX to not generate MX_RTC_Init() function and it has been working normally so far. (I'm using LSE) I need to update t...
sbtek
1

votes
0

answer
158

Views

STM32F415 Problems with I2C

I am using a STM32F415RGT6 embedded in the 1Bitsy Board. I want to set up the I2C Peripheral in order to read some data from a sensor. I am using the stm32f4 standard peripheral library. My example code: RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); GPIO_InitTypeDef gpioInit; GPIO_StructIn...
Dustin Lehmann
1

votes
0

answer
191

Views

STM32L082xx AES128 CBC Hardware Encryption using ST's HAL

Decryption is not working as intended on STM32L082xx. Here is my attempt: I'm using all zeros as iv and key and all 0x42 for plain text. If I do the same thing in python I get a different result: I get {0x7c,0xA5,0xDA,0xBF,0x97,0x18....} Note I'm using key and IV which are not influenced by endian...
Flying Swissman
1

votes
0

answer
598

Views

STM32 MBED stop mode - timer not working after wakeup

I'm using MBED on STM32F437 MCU (my own target) and trying to properly reach STOP mode. This MCU doesn't have LPTIM (low power timer) so I'm trying to configure RTC (or WKUP pin PA0) to wakeup MCU a few seconds after STOP. So far so good. But there is problem after wakeup. MCU is running, serial pri...
Martin Borýsek
1

votes
0

answer
59

Views

Using Makefile on Eclipse with MinGW

I installed Eclipse with CDT for a STM32 project on Windows 10. I installed the ARM toolchain plugin and the GNU MCU Eclipse Windows Build Tools. Before that I already had MinGW and the GNU ARM toolchain. I imported a Makefile project. I created a new target. When I double click on the new target, t...
1

votes
1

answer
631

Views

DMA on STM32F4 doesn't work, is my configuration wrong?

I'm working on a project for a digital filter, see figure below. I have timer 3 triggering the ADC at 40kHz, the ADC should then make a sample and when its conversion is done it should trigger the DMA. The DMA should then move the converted value from the ADC peripheral memory to a memory address. T...
Mauricio Paulusma
1

votes
2

answer
175

Views

setting up the clock on my nucleo-L432KC for a 5 channel adc conversion using DMA

So i have been trying to set up my ADC conversion on my Nucleo-L432KC and have been having a hard time. i recently have been working on a Nucleo-F303RE which is a 64 pin nucleo and my 5 channel ADC conversions using DMA where working great. I then decided to downgrade to a nucleo-L432KC (32 pin nucl...
1

votes
0

answer
75

Views

Microcontroller sending HID keyboard reports works correctly with macOS but not Windows

I'm creating a device that sends USB HID Reports from the device to the computer. if(toggled == 0x01){ // if in toggled state if(currentMillis - previousMillis >= 40 && pending == 0x00){ // if 40 ms has passed since last key up hid report USBD_HID_SendReport(&hUsbDeviceFS, &report, sizeof(report));...
user1113569
1

votes
2

answer
758

Views

STM32 - RS485 request-response

I am trying to send request to measuring device and receive it's response using UART with interrupts. However communication is unstable, I am receiving incomplete or corrupted responses. I am not sure but I think it's because switching driver enable signal. Could you look at my code and give me some...
V.CHR.
1

votes
0

answer
108

Views

PySerial : can't write until I disconnect STLink USB cable

I'm working on some software, which involves communication between PC and embedded device over UART. I'm using STLink's USB/Serial adapter. Most of the time communication works fine, but after some time (can be hours/minutes or even days) I got write timeout which I can't solve from software level -...
user2046193
1

votes
1

answer
48

Views

BLDC Isolated sensorless control

I've currently developed a BLDC motor controller and it generally works fine. During some events however the microcontroller locks up (e.g. stopping the motor or fast changes of duty cycle). Because of this, I want to isolate the microcontroller from the power side (i.e. isolated supply and optocoup...
Pyrohaz
1

votes
0

answer
342

Views

Strange behaviour of STM32 ADC with external trigger

I'm on STM32L476. I have setup my ADC to be triggered by TIM15. There is only one channel, single conversion mode. On ADC side, to enable interrupts I clear the ADC ISR register and then set ADC_IER, before starting the conversion. If I enable in AED IER both EOSIE and EOCIE, everything works fine i...
1

votes
0

answer
615

Views

DMA Transfer Complete call is not synchronized with the SPI on STM32F446

I want to use an STM32F446RE-Nucleo board to readout an MCP3201 ADC at a regular frequency. I want to perform the communication with the ADC using SPI and DMA to write the data directly into the memory. My code (displayed below) for the STM32F446RE is structured as follows: The SysTick interrupt (se...
user3316041
1

votes
0

answer
40

Views

SIM900 Reception buffer issues

Actually I'm working with SIM900, I have a problem with Reception character, so I can't receive an 'OK' for each message that I send to the chip. I would like to send an SMS or make call. I use STM32F429 waveshare board and below and the functions that I implemented for the communication: void SIM90...
zinhom69
1

votes
2

answer
320

Views

I2c communication stm32f3 how can i solve?

i want to read touch activity from the touchscreen.If i touch, i want to led blink. Some my definitions in below code but generally i want to get my activity with i2c Some definitions: uint8_t deviceaddr; static uint32_t touch_i2c_read(uint8_t DeviceAddr, uint8_t RegAddr, uint8_t *pBuffer, uint16_t...
1

votes
0

answer
94

Views

Getting the coordinates from touchscreen

I have a some problem at the my touchscreen. I am using FT6236 touch screen driver for the TFTM032 touch screen. I get the touch information from the i2c protocol but i dont know how can i determine the coordinates. I am using stm32f3 discover board and programming with the standard perhipral librar...
1

votes
0

answer
128

Views

STM32F3 C programming: Stuck at channel selection while implementing ADC

Short version: Need help with C programming to select channel/s for ADC in STM32F3(Dicovery board). Please find the code that I have written as of now at the end of the question. It would be great if anyone can refer to some resources for bare metal programming. Long Version: I am learning programmi...
easwaran
1

votes
1

answer
131

Views

STM32 VCP driver - pointer becomes invalid only with optimization

I am working on an embedded project with the STM32F405 microcontroller, and have some really confusing behavior. I am porting an existing (working) project from the STM32F1 to the STM32F4, but I have added ST's standard peripheral library USB stack for VCP. If I compile the program with -O0 optimiz...
superjax
1

votes
1

answer
99

Views

ReadFile() gives error 998 when trying to read data from USB port

I'm trying to send data from a STM32 Discovery Board to a host PC via USB using my own application. I managed to send data to the STM. I used WriteFile for that. For reading data I am calling the function readSerialPort() which calls the function ReadFile(). In main.c readSerialPort() is called in t...
Fluxable
1

votes
1

answer
221

Views

stm32 ETH_IRQHandler never hit

Im using stm32f746ZGT + LAN8472A and lwip + freertos on my custom board. I generated default ethernet project by cubemx. I set static ip. After connect the cable Link leds seem like good. Yellow one is stable and green one is blinky. In debugging i can see netif is fully configured and link is up....
1

votes
0

answer
69

Views

Qbs: run googletests while building arm target

I use qbs (inside Qt Creator) to build my STM32 project and upload it using the baremetal plugin. And it works great. But I also have tests for the libraries used in my firmware. And for sure I would like to build and run them. Now I need to prepare another project which is configured for Windows/L...
johngull
1

votes
3

answer
161

Views

SysTick interrupt causes execution to jump to 0x1fffxxxx on STM32F030

I'm trying to use SysTick_Handler in SW4STM32 for Linux, but whenever the SysTick interrupt is triggered, execution jumps to somewhere in system memory. By my understanding, it should jump into the void SysTick_Handler(void) that I declared, or failing that, into Default_Handler declared in startup_...
Charles The Hat

View additional questions