[DEV] STM32H7xx support (new)

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
mikeprotts
Posts: 166
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 19 times
Been thanked: 31 times

Re: [DEV] STM32H7xx support (new)

Post by mikeprotts »

I'll take a look, may be a few days.

Thanks
Mike
mikeprotts
Posts: 166
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 19 times
Been thanked: 31 times

Re: [DEV] STM32H7xx support (new)

Post by mikeprotts »

A quick check & it's running, but will be a while before I can give better confirmation.

I've created patches (svn diffs) for the issues others had spotted and my use of memory pools for LWIP.

MACv2 (bugs in my code):
MACv2.xPS_SUSPENDED.patch to correct the registers used when checking for transmit or receive suspended state

STM headers (an existing bug, needed for MACv2):
STM32HxxETHi_DMADSR_RPS.patch to correct the stm32h???xx.h definitions for ETH_DMADSR_RPS_SUSPENDED etc. I think all the STM32H7 boards with Ethernet support should be the same, but I only have an early H743 variant to test with.

LWIP (additional options - not needed for MACv2):
LWIP_USE_MEM_POOLS.patch to add support for chHeapAlloc as an alternative to chPoolAlloc (kept as the default in os/various/lwip_bindings/arch/sys_arch.c).

Mike
Attachments
threepatches.tgz
(2.09 KiB) Downloaded 661 times
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [DEV] STM32H7xx support (new)

Post by Giovanni »

Hi,

I cannot patch ST headers or the change will be lost on next update, I suggest you undef the wrong definition in the driver C module and define the correct one there. You may see similar workarounds in several other drivers.

Giovanni
mikeprotts
Posts: 166
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 19 times
Been thanked: 31 times

Re: [DEV] STM32H7xx support (new)

Post by mikeprotts »

That makes sense - I'll get onto that, probably later next week though. Is there a preference to do this in the header or source file? If I keep it as a separate patch, it will make it easier to revert if no longer needed when the ST headers are corrected.

The other patches stand I think.

Cheers
Mike
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [DEV] STM32H7xx support (new)

Post by Giovanni »

Hi,

Patches added, I also implemented the headers workaround in hal_mac_lld.c, to be tested.

Giovanni
mikeprotts
Posts: 166
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 19 times
Been thanked: 31 times

Re: [DEV] STM32H7xx support (new)

Post by mikeprotts »

I've had this running for five days now, seems to be stable running as a web server and MQTT client. Only tested with the original STM32H743 with Nucleo-H743ZI.

Mike
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [DEV] STM32H7xx support (new)

Post by Giovanni »

Hi,

I had to make changes to the LLD MACv2 driver because the MAC driver is being updated. I added an H7 demo using the STM32H735-Discovery under /demos/STM32/RT-STM32-LWIP-FATFS-USB but I am unable to make it work for some reason, basically I just changed the ISR structure but it never gets in there.

I suspect there is something with my board integration, could anybody confirm that the MACv2 driver is still working on their boards?

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [DEV] STM32H7xx support (new)

Post by Giovanni »

Never mind, it is working, it was an integration problem. I will be making improvements to both MAC drivers in next days.

Giovanni
mikeprotts
Posts: 166
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 19 times
Been thanked: 31 times

Re: [DEV] STM32H7xx support (new)

Post by mikeprotts »

I'll try to update to the latest code and give this a test in the next few days.

Mike
mikeprotts
Posts: 166
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 19 times
Been thanked: 31 times

Re: [DEV] STM32H7xx support (new)

Post by mikeprotts »

Catching up with this. As my code was still on 20.3 I tried trunk first, and then these releases. in each case using new chconf.h, halconf.h and mcuconf.h.

trunk Ethernet not responding, some warnings to fix for SPI
21.11.2 Ethernet not responding, some warnings to fix for SPI
21.6 no issues
21.11.1 Ethernet happy - but some warnings I need to fix for SPI
21.11.0 Ethernet happy - but some warnings I need to fix for SPI

So I will need a little time to get to trunk testing. I'll sort out the SPI warnings first so they don't confuse matters (I think just a tweak to the config), then I'll see what's changed between 21.11.1 and 21.11.2 that would stop Ethernet responding.
Post Reply