Remora - Rpi Software Stepping Using External Microcontroller via SPI

More
4 years 4 months ago #246324 by scotta
Hi cakeslob, great to hear that things are slowly moving forward.

I'm guessing you have made a new target in custom_targets.json, adding  "bootloader_supported": true as an options should allow it to compile. I'll need to set one up to see.

Timers 3,4 and 5 area all on AHB1/APB1 according to the bus diagram.

I'll need to look at the DMA as there is MDMA and DMA controllers. Hopefully using the DMA controller will not mean to many changes needed.

Once I'm finished with the Remora-EC500 code, I'll need to get one of these boards to try and help out.

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #248086 by scotta
A very generous forum member sent me an SKR3 for development. Thanks so much to them!!!

The STM32H743 used on the board is a beast and a step above in features and capability, which also brings some complexity and a steep learning curve to get this up and running.

I'll be calling on anyone with H743 experience to help out with this one.

First step - getting a "Hello world" working.

1. STM32CubeIDE: working with and without bootloader
2. Mbed: working without bootloader but hard faulting with bootloader

Step two - getting the SD card working with the SDMMC interface. This is probably the biggest challenge.

@JojoS your Mbed SDIO for the F4 worked a treat. Hoping your experience might help here for the H7? Attempts with STM32CubeIDE have failed to get the SD to mount.
The following user(s) said Thank You: tommylight, cakeslob

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago - 4 years 3 months ago #248173 by JojoS
I have now a version that compiles (very dirty) for H7, but is not yet working. The DMA stuff is really completely different. But I'm hopeful :)

www.st.com/resource/en/application_note/...microelectronics.pdf
heavy stuff...

update:
I have created a branch for the H7 in my github repo github.com/JojoS62/COMPONENT_SDIO/tree/add-h7-sdio
Status is still not working ;(
The DMA for the H7 should be easier if not the highest speed modes are used. The SDMMC has a dedicated DMA, called IDMA. This does not need configuration like the general DMA channels on the other MCUs.So everything should be easier.
Calling sd.init() is returning success and the SD info about size is correct. But reading a sector with DMA fails with timeout. I have an IRQ handler for the SDMMC1 irq (yet fixed to SDMMC1) and this is never called.
Tried also a lot of different clock speeds and settings for SDC Init, nothing worked. There is a similar use case in betaflight sofware, it looks really similiar.
And also reading blocks without DMA fails, so something wrong after switching to 4 bit mode.
Last edit: 4 years 3 months ago by JojoS. Reason: updated info
The following user(s) said Thank You: tommylight, scotta, cakeslob

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago - 4 years 3 months ago #248343 by JojoS
some good news: the version in my repo is now working roughly.I haven't added the cache flushes yet, that is necessary when D-Cache is enabled. In my test app I have disabled the DCache and I can read my SD cards. The proper code needs some more work. For reading, the cache flush is needed after reading operation. But this is an async operation with DMA, so the DMA complete has to know the readbuffer address and size.
The strange trick was to enable the `hsd.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_ENABLE;` I haven't figured out why, but when it is disabled like in other examples, no interrupts were fired.

Another strange (Mbed) thing is the SLEEP feature. It uses __WFI to bring the MCU to sleep mode during ThisThread::sleep_for(). But this detaches the debugger and so I like to disable or remove this feature. When I remove SLEEP, then the SD Component fails again. With SLEEP component and locking the sleep manager, SD works, but restarting the programm works only in a few times. Ok, that may be some Mbed problem.

Tomorrow the arrival of the SKR3 is expected and I can test also with the correct target hardware.
Last edit: 4 years 3 months ago by JojoS. Reason: fix tyo
The following user(s) said Thank You: cakeslob

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #248376 by scotta
Great news JojoS, thanks for this. I'm curious now if it's sleep functions which are causing my attempts with the H743 to stop when using the bootloader and bare metal profile.

Remora uses bare metal profile to remove the RTOS overhead, but I've never really investigated the sleep features. But we have targets that don't play when trying to use the standard bootloaders that come with the boards.

Please Log in or Create an account to join the conversation.

More
4 years 2 months ago #249584 by viesturs.lacis

A very generous forum member sent me an SKR3 for development. Thanks so much to them!!!
 
Hello! Could you please share current status of SKR3 board regarding Remora?
 

Please Log in or Create an account to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum