New answers tagged

1

Sure you can use RTOS even for small projects, even when it might make little sense, it is better to start with simple project than to start with complex project. ST officially supports FreeRTOS with STM32 MCUs. Read the FreeRTOS manual how you might want to use it, like having a I2C thread, message passing interface between threads or mutual exclusion etc..


1

You can use CubeIDE with integrated CubeMX configuration tool to write software, compile, build, program and debug, by using ST-LINK/V2 interface and using both SWD and JTAG protocols.


1

You violate the sequence by clearing the ADDR bit first, and then setting ACK and POS bits. So the sequence in your code is not according to what the manual says. Clearing the ADDR bit already starts the transmission of next byte, so by the time the code goes to setting ACK and POS bits, it is too late to set them anymore, and it uses the settings where NAK ...


3

There is no difference. The CS is always from master to slave, as master is the one that generates the clock, and slave always listens for the clock (and it basically is gated by the CS). Basically when the master transmits a byte to slave, it also receives a byte from the slave. If you want the master to receive data from slave, the slave must set the ...


3

Is it used to reset the program which we flash and allow us to program it again? It seems you are confused about what reset actually resets. It does not "reset the program", it resets the MCU. The content of flash is not changed, so previously written program is still available. Specifically, while NRST pin is connected to the ground the MCU stays in "...


3

It resets the MCU. In order to flash the MCU, the ST-LINK resets and then sends the program through SWD. It should be self explanatory that MCU can't run the program and being flashed at the same time. So how to stop the CPU execution and invoke the bootloader? The first step is to reset it.


0

@BobJacobsen Hey, I found a solution some time ago, I forgot to describe it. The problem was really on the hardware side but it's quite unusual. The instrument panel cluster from the car I'm connecting to has already 2 resistors built in and is like a separate CAN network. After removing ALL terminations (I soldered out a 120 ohm resistor from the transciver)...


0

I found a solution some time ago, I forgot to describe it. The problem was really on the hardware side but it's quite unusual. The instrument panel cluster from the car I'm connecting to has already 2 resistors built in and is like a separate CAN network. After removing ALL terminations (I soldered out a 120 ohm resistor from the transciver) everything ...


1

Both stm32f103 and stm32f401 have the SWD, so you should be able to use the ST-Link V2 to program them, just make sure to follow the datasheet regarding the programming pins (like keeping them dedicated to programming or avoiding low impedance things connected it). From the ST Link V2 ST website The ST-LINK/V2 is an in-circuit debugger and programmer for ...


0

Not all pins are 5V tolerant. You haven't mentioned which pin you are using, but the datasheet lists the IO pin type so when you know which pin is used you can see if it is 5V tolerant or not. PA3 is not 5V tolerant, but the other three pins than can be mapped to USART1_RX are.


2

The manual (https://www.st.com/resource/en/datasheet/stm32f030f4.pdf) on page 28 has the info about the I/O structure: Page 29 tells you what you need to know about your PA3 pin: I am sorry to inform you that it is not 5V tolerant. You could use a simple voltage divider on the USART input (RX) to bring it down to a more compatible level. Better ...


3

Your NMOSFETs achieves their rated \$R_{dson}\$ at 4V but your STM32 output pins only apply 3.3V. Your PMOS gates achieve their rated \$R_{dson}\$ at 10V but you are only applying 5V to it. Your MOSFETs get hot and your motor doesn't move because your MOSFETs are only partially turning on, acting as resistors that heat up a lot, but don't allow enough ...


28

Each manufacturer labels its parts however it likes, usually explained on the datasheet or ordering information of its web site. For this particular part, a STM32F407VG is in a 100-pin package (V) and has 1024 Kbytes of memory (G). From the ordering page of the datasheet: From STM32 datasheet https://www.st.com/resource/en/datasheet/stm32f407vg.pdf


0

One reason that pressing reset can be needed, is when the application disables the SWD pins, to use them as GPIOs. While reset is pressed, SWD is always enabled, so you can always connect with SWD while reset is pressed. I have found that the Arduino_STM32 core by "rogerclarkmelbourne" in fact always disables the SWD pins, see this commit. This would mean ...


3

The power line tends to be noisy at the peaks of the voltage waveform because any piece of equipment that contains a non-PFC power supply tends to draw all of its current in narrow pulses only when the rectified voltage exceeds the internal DC voltage on its filter capacitor(s). The noise is emphasized in your second waveform probably because your load is ...


2

Yes. It's pretty straightforward. As long as your timer clock is fast enough you should have no problem grabbing edges with a timer. You may need to do a bit of math when the timer overflows if you're grabbing continuously. Or you can tweak your clock speed. it's doable. This is called "input capture". I think you'll find it not too difficult to get set up. ...


0

One technique I've used to minimize this effect is to sample an unused channel tied to ground in between sampling the active channels. The resistor values you are using are on the high side. I haven't specifically used that processor but on other devices, it is recommended to keep the source impedance to less than 10k ohm. It can help if you add a ...


0

What you can do is to create a queue on the interrupt to store the period. Because the sampling frequency should be at least double the PWM frequency ,you have to handle the period asynchronously (because the main loop may be slow to handle these frequencies) .I had the same issue quite some time ago but instead of a PWM I had a saw tooth with variable ...


1

Well, an external watchdog is immune to you messing up your code and has more flexibility. An external watchdog is also more suited for a system with multiple processors/FPGAs that might need to be under the purview of a single watchdog. So...it depends...Usually for simple systems or system where safety or catastrophic failure is not an issue, an external ...


1

simulate this circuit – Schematic created using CircuitLab STM32, as from User323693 previous answer, has a "Single Wire" mode very close to what "onewire" require for. Caveat about is we require a simultaneous receive and transmit to implement OW over Usart. ST provide HAL_HalfDuplex_EnableTransmitter(), HAL_HalfDuplex_EnableReceiver() this way ...


0

If you have nothing (more) to send, then you need to disable your UART_IT_TC interrupt. This interrupt flag is set whenever the UART Transmit buffer is empty, so since you don't even load anything into the Transmit buffer this flag will always be set, resulting in the micro continuously jumping to your interrupt handler and never executing any other code. ...


1

Your init-function is probably not doing what you want. Currently you only call the set functions if the bits are in a certain state. What you want to do is wait until the bit is in the correct state and then execute the set function. Wrong guess: So my guess is that the second statement is never executed and the reload register stays at the standard ...


0

From the schematic it appears that you want to monitor the status of a signal that switches between +9 to +32 V and GND (0 V). Switching pull-up to pull-down is an unusual approach and not necessary. With R2 = 40 kΩ you will easily detect a 'high' on the input. With SW1 grounded R2, R4 and R1 form a potential divider on the input. The input voltage ...


0

For what it's worth: in this link: https://www.bluetin.io/displays/nokia-5110-display-raspberry-pi-guide/ the same display as you is being used. At the end, there is in Buying Featured Items - Adafruit a link added (named Nokia 5110/3310 monochrome LCD + extras), the link is: https://www.adafruit.com/product/338 This link shows a different pin-assigned ...


2

As usual, the programming manual is a good place to start. Take a look at page 429: So the line: TIM3->PSC = 30000-1; Sets the prescaler to 30000. The ARR (auto-reload) register is configured as: And the line: TIM3->ARR = 2-1; Sets the value to 2-1 (which is 1, and I'm not sure why they are doing it that way). So for the STM32, the ...


0

I know I am bit late on this, but I think my answer may help.somebody. Why not give the task of smps to the chip which is designed for it? Use SG3525 in push pull configuration. Short it's pins 1 and 9. Then supply voltage from 0 to approx 3.6 to its pin 2 to control the duty. You can use the PWM output of uC and have low pass filter ahead to convert the ...


0

The problem lied in a compiler I was using. By default Keil uses ARMCC (default compiler 5). When I switched to ARMCLANG (default compiler 6), the problem resolved.


0

That usually happens when the prototype is not included. Have you included the relevant .h file?


1

The STM32H732VI has a LCD-TFT peripheral to drive the RGB interface directly, but if you don't want to use it, you better use the Flexible Memory Controller (FMC) peripheral to map the LCD display into memory bus, so DMA can be used with it. Connecting it to simple GPIOs can't really use DMA, or at least it would be awkward to use DMA to toggle GPIOs to get ...


1

If you don't use PWM, you just get the motor running at whatever speed the supply voltage determines - it's roughly proportional. Your bridge should be OK, the components are more than sufficient. You do know that you have to set one of the PWM inputs high at the same time as the diagonally opposite high side control input to get a current path through the ...


0

I'd just use a L298 Driver IC. They are pretty simple. I don't like messing with P channel transistors. You should check the datasheet for the appropriate thershold volatages and check what you're actually getting on your circuit


1

You need to make 'value' volatile or perform some dummy operation on it after loading to prevent your compiler from optimizing out. Bonus tip, if you're in System Workbench, you might want to change your compiler settings to 'optimize for debug' if you're using a debugger tool. You also may want to consider using the DMA peripheral, which pairs nicely with ...


0

This line is wrong, it's enabling G1_IO4 (PA3) not G1_IO3 (PA2) as intended. TSC->IOSCR |= 0x04; //enable G1_IO3 (PA2) as sampling capacitor I don't use IOASCR in my working setup, you can see the counter output below, low count = insulated electrode touched. I'd show you my code but I don't use C and you probably don't use Forth. 4887 4868 4838 ...


0

I had what sounds like the same problem on an STM32F302R8. I solved it by lowering the GPIO output speed of the MISO pin from HIGH to LOW. WAS: GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; IS: GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;


Top 50 recent answers are included