Search found 50 matches

by joaquin
Sun Nov 01, 2026 7:22 am
Forum: STM32 Support
Topic: STM32 + RS-485 Modbus RTU: How do you handle frame timing and UART receive reliably?
Replies: 2
Views: 377

Re: STM32 + RS-485 Modbus RTU: How do you handle frame timing and UART receive reliably?

This is how I implemented modbus, it has been working reliably at 4 sites:

// timeout between MB frames (3.5 times a character timeout)
// for baud>19200 is 1,75 ms
uint32_t ponUsInterMsg(uint16_t baudios)
{
if( baudios > 19200U )
return 1750U;
else
return (uint32_t) (38500000/baudios ...
by joaquin
Fri Apr 11, 2025 11:11 am
Forum: STM32 Support
Topic: SD on STM32H7
Replies: 15
Views: 38335

Re: SD on STM32H7

Could you try another card? is the capacity still wrong? if so then there could be a bug there.

Giovanni
With a 8GB card, it reports 15.130.624, with a 64GB, it reports 122.138.624 and with a 256MB, 491.520
I have checked on a PC, and the reported capacity by Chibios is correct, although it's in ...
by joaquin
Thu Apr 10, 2025 3:04 pm
Forum: STM32 Support
Topic: SD on STM32H7
Replies: 15
Views: 38335

Re: SD on STM32H7

Giovanni wrote:Could you try another card? is the capacity still wrong? if so then there could be a bug there.

Giovanni

With a 8GB card, it reports 15.130.624, with a 64GB, it reports 122.138.624 and with a 256MB, 491.520
by joaquin
Thu Apr 10, 2025 10:09 am
Forum: STM32 Support
Topic: SD on STM32H7
Replies: 15
Views: 38335

Re: SD on STM32H7

Giovanni wrote:Hi,
How do you verify the reported capacity?
Giovanni

At hal_sdc.c :

Code: Select all

  else {
    /* The card is an SDC, capacity from the normal CSD.*/
    sdcp->capacity = _mmcsd_get_capacity(sdcp->csd);
  }

I'm illiterate at SD Card code, so may be it's not the way to check it
by joaquin
Wed Apr 09, 2025 6:25 pm
Forum: STM32 Support
Topic: SD on STM32H7
Replies: 15
Views: 38335

Re: SD on STM32H7

Try disabling the cache globally and see if it makes a difference.
The code is in crt1.c, comment out the likes 262 and 263.
Giovanni
I have rebuilt it from scratch, and now it seems that it initialices the card, although the reported capacity from the card is 16GB instead of the 8GB it actually ...
by joaquin
Fri Apr 04, 2025 5:56 am
Forum: STM32 Support
Topic: SD on STM32H7
Replies: 15
Views: 38335

Re: SD on STM32H7

Are GPIO settings correct?
Giovanni

I think so, as GPIO pins are the same on the STM32H743 and for STM32H735. As for PORTC (PD2 are identical to PC8..PC12):

/*
* GPIOC setup:
*
* PC0 - GPIOC_SPI1_CS2 (output pushpull).
* PC1 - GPIOC_4_20mA_1 (analog).
* PC2 - GPIOC_D_C (output ...
by joaquin
Thu Apr 03, 2025 1:15 pm
Forum: STM32 Support
Topic: SD on STM32H7
Replies: 15
Views: 38335

Re: SD on STM32H7

Hi,
I just retested on my H735G-DK, it works. You should check GPIO settings then clock settings in your board files.
Giovanni
I have revisited every detail and clock configuration (my uC is a stm32h743 instead of an stm32h735, it requires changing clock settings) without success; with CubeMX ...
by joaquin
Thu Mar 27, 2025 10:51 am
Forum: STM32 Support
Topic: SDMMC on STM32H735G-DK failed at connect
Replies: 4
Views: 19800

Re: SDMMC on STM32H735G-DK failed at connect

I tested the H735 development kit further with SD card tester code created using CubeMX without OS.
The result is OK

This is the debug output

......
[17:04:07:855] Block 1596, wrote 65536 bytes in 16 ms␊
[17:04:07:864] Block 1597 ...
by joaquin
Sun Mar 23, 2025 9:39 pm
Forum: STM32 Support
Topic: SD on STM32H7
Replies: 15
Views: 38335

Re: SD on STM32H7

With the STM32/RT-VFS-FATFS, I adapted the board from the original STM32H735 to the STM32H743 I have in my board, with the minimum changes. It fails at exactly the same point:
- At sdcConnect(&SDCD1)...
- When it switches to high speed calling detect_bus_clk(sdcp, &clk)...
- It calls sdc_detect_bus ...
by joaquin
Sun Mar 23, 2025 7:41 pm
Forum: STM32 Support
Topic: SDMMC on STM32H735G-DK failed at connect
Replies: 4
Views: 19800

Re: SDMMC on STM32H735G-DK failed at connect

I had just posted the same problem with an Aliexpress board using the same CPU. Giovanni suggested to try the demo incuded at /demos/STM32/RT-VFS-FATFS and prefixing all FatFS structures with "__nocache_", to avoid the cache nightmare of this CPU.
Right now I'm comparing that demo with my code, but ...