Page 17 of 18

Re: Where to start STM32H7 support

Posted: Mon Jan 13, 2020 8:46 pm
by Giovanni
I must have missed it... anyway, I will give it a look.

Giovanni

Re: Where to start STM32H7 support

Posted: Mon Jan 13, 2020 9:16 pm
by tridge
One thing I didn't finish on SDMMCv2 is setting the clocks correctly. I just left a #warning in the code:
https://github.com/ArduPilot/ChibiOS/bl ... lld.c#L519
It works like this, but the transfer rate isn't as fast as it should be. We normally don't need really fast transfers to/from microSD in ArduPilot so I didn't put more time into it. That may change as we are looking at adding OTG_HS support, and users will want to take advantage of that for fast log downloads.

Re: Where to start STM32H7 support

Posted: Tue Jan 14, 2020 10:21 am
by Giovanni
I committed an untested driver.

Tridge, there several things I don't understand in your implementation so I cannot use it as-is, in additions it refers some external code (bouncebuffer) which is not part of the driver.

I made the minimal changes to SDMMCv1 to use IDMA instead of DMA, I will test as soon I get a board with an SD connector.

Giovanni

Re: Where to start STM32H7 support

Posted: Thu Jan 16, 2020 2:17 am
by tridge
Giovanni wrote:Tridge, there several things I don't understand in your implementation so I cannot use it as-is, in additions it refers some external code (bouncebuffer) which is not part of the driver.

yes, I have bouncebuffer hooks in SDIOv1 and SDMMCv1 too. I really don't understand how other ChibiOS users are surviving with complex code and FATFS without bouncebuffers and without driving themselves mad. There are so many memory regions on recent MCUs with restrictions on what regions can be used with what devices. Without the bouncebuffer hooks user code must be doing a bunch of extra work to ensure they use memory that works with each device.
For things like SPI and I2C we place the bouncebuffer hooks in the higher level ArduPilot code so the ChibiOS LLD can remain clean. For the SDIO and SDMMC we can't do that as FATFS is calling these functions without going via any ArduPilot code.
I really think ChibiOS should have an optional bouncebuffer abstraction. You can see the implementation we have for ArduPilot here:
https://github.com/ardupilot/ardupilot/ ... cebuffer.h
https://github.com/ardupilot/ardupilot/ ... cebuffer.c
I made the minimal changes to SDMMCv1 to use IDMA instead of DMA, I will test as soon I get a board with an SD connector.

I'm very happy to send you one of the ArduPilot supported boards that has an H743 if you like. I did offer this previously but never got an address to send it to.
Cheers, Tridge

Re: Where to start STM32H7 support

Posted: Sat Jan 18, 2020 11:37 am
by Giovanni
Hi Tridge,

I committed an SDMMCv2 driver, it is a bit different because it uses a new mode of starting the data state machine, setting DTEN is no more "valid" even if it still works apparently. It also includes some clock-related improvements. Timeouts handling is different too.

I tested it on STM32L4R9, it compiles on H7 but I have not tested it yet, it seems to be exactly the same IP.

I agree with you that H7 makes things unnecessarily complex when using SDC, the driver assumes that the stack is DMA-accessible and this is not necessarily the case. I will change the driver structure soon, this should make integration easier.

About the board, I will send you an address in PM, I imagine you already have board files done, right?

Giovanni

Re: Where to start STM32H7 support

Posted: Sat Jan 18, 2020 11:11 pm
by tridge
Giovanni wrote:I committed an SDMMCv2 driver, it is a bit different because it uses a new mode of starting the data state machine, setting DTEN is no more "valid" even if it still works apparently. It also includes some clock-related improvements. Timeouts handling is different too.

Thanks! I'll take a look
I agree with you that H7 makes things unnecessarily complex when using SDC, the driver assumes that the stack is DMA-accessible and this is not necessarily the case. I will change the driver structure soon, this should make integration easier.

yes, this problem is also on F7, it hits for example the dummytx, dummyrx words in SPIv1/SPIv2. That really restricts what memory layout you can use. I added dummy words in the config structure to fix that, so the caller can give dummy words to the lld.
About the board, I will send you an address in PM, I imagine you already have board files done, right?

we auto-generate board files for ArduPilot. I can do a patch for you that adds board files for the board I'll send you for ChibiOS master.
Cheers, Tridge

Re: Where to start STM32H7 support

Posted: Wed Feb 26, 2020 3:20 pm
by JSStabl
How is the timeline of the CAN support for the h7? Anything I can do to help?

Also has anybody tested the h7 dualcores with chibios?

Re: Where to start STM32H7 support

Posted: Wed Feb 26, 2020 4:35 pm
by Giovanni
JSStabl wrote:How is the timeline of the CAN support for the h7? Anything I can do to help?

Also has anybody tested the h7 dualcores with chibios?


CAN support will start soon, it is the next thing in the list.

I tried just the M7, anybody knows how to debug the M4 using OpenOCD and ST-Link? that is the blocking point right now.

Giovanni

Re: Where to start STM32H7 support

Posted: Thu Feb 27, 2020 8:58 am
by JSStabl
I managed to flash the M4 Core on the STM32MP1, unsure if its similar for the H7. Needed to put the Board into "engineering mode" for that.

Re: Where to start STM32H7 support

Posted: Sat Mar 14, 2020 11:01 am
by Giovanni
SDMMCv2 driver is working on an L4+, could somebody confirm it is working on the H7? Tridge?

Giovanni