Remora - Rpi Software Stepping Using External Microcontroller via SPI

More
24 Oct 2021 22:11 - 24 Oct 2021 23:07 #224126 by cakeslob
Im using studio, ive compiled the stm32 repo just fine. I also find it strange, I just download the git, open a workspace in remora os5, and download the libraries within studio, says its 5.15.0. Select target, SKRV2 or OCTOPUS, and build. The file LPC17xx.h is there under targets/nxp/device . Says everything is up to date for mbed studio

Building project firmware (OCTOPUS, ARMC6)
Scan: Remora-OS5
Using ROM region application in this build.
Region application: size 0x78000, offset 0x8008000
Compile [ 0.7%]: MODDMA.cpp
[Fatal Error] iomacros.h@27,10: 'LPC17xx.h' file not found
[ERROR] In file included from .\MODDMA\MODDMA.cpp:22:
./MODDMA/iomacros.h:27:10: fatal error: 'LPC17xx.h' file not found
#include "LPC17xx.h"
^~~~~~~~~~~
1 error generated.

this is the full output, I was just wondering if there was some secret

MODDMA lib
Commit: 97a16bf2ff439853ed01edd65a382207e203c733
Imported from: os.mbed.com/users/AjK/code/MODDMA/

mbed-os 5.15.0
Commit: 64853b354fa188bfe8dbd51e78771213c7ed37f7
Imported from: github.com/ARMmbed/mbed-os/
Tool Name Version Status
ARM Compiler 6.16 up to date
Clangd 12.0.2 up to date
Example projects 1.10.1 up to date
GDB client 6-2017-q2-update up to date
Git 2.30.0 up to date
Mbed Library Cache 1.10.0 up to date
Python tools 0.6.0 up to date
Debug Packs 1.1.0 up to date
edit, ok I was doing something with the MODDMA lib that was messing it up
Last edit: 24 Oct 2021 23:07 by cakeslob.

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

More
25 Oct 2021 03:29 #224174 by scotta
Hi, the MODDMA library is already included in the repo in the correct location within the TARGET_SKRV1_4 directory. No need to import it again, which will put in the root directory and in the compile path.

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

More
26 Oct 2021 00:28 #224312 by cakeslob
Thank you for your help and patience. Yeah studio was saying i should "fix" the mbed-os and moddma lib. That explains why the stm32-repo worked and the main didnt.
How do I go about debugging this octopus? something like FTDI ,stlink or JTAG?? Can we hook these up USB like the official mbed boards and debug within studio? Ill break what ever I have to...
What I do know
I have reset pin on PC_15 in my config
Firmware loads and makes a cur file
Leds look like they are loading firmware and acting proper
12v power
Bad SPI payload = 0
No output on the serial
Memory does not look corrupted and bootload/firmware are on the correct address lines
SKR2 for reference, works on my setup.

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

More
26 Oct 2021 07:49 #224341 by gtt38
look if ur connected to the right spi port.

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

More
26 Oct 2021 20:09 - 26 Oct 2021 20:11 #224420 by gtt38
@scotta : Do you think it is possible to connect until 5 MCU like the rpspi.c driver ? or maybe start with 2, one on the RPI SPI0 and an another on the RPI SPI1
Last edit: 26 Oct 2021 20:11 by gtt38.

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

More
26 Oct 2021 23:23 #224444 by scotta

Thank you for your help and patience. Yeah studio was saying i should "fix" the mbed-os and moddma lib. That explains why the stm32-repo worked and the main didnt.
How do I go about debugging this octopus? something like FTDI ,stlink or JTAG?? Can we hook these up USB like the official mbed boards and debug within studio? Ill break what ever I have to...
What I do know
I have reset pin on PC_15 in my config
Firmware loads and makes a cur file
Leds look like they are loading firmware and acting proper
12v power
Bad SPI payload = 0
No output on the serial
Memory does not look corrupted and bootload/firmware are on the correct address lines
SKR2 for reference, works on my setup.

Hi, I've fixed the MODDMA issue in the develop branch. There was a MODDMA.lib file in the root directory. This is what was prompting people to download the lib.

So the SKR2 bin works on the Octopus board..? Interesting. The CPU frequency would be slower than possible. But it does help narrow down the problem. The only difference between the two builds is the system_clock.c file in the target directory. And this is really only setting the frequency to 180MHz. 

The only other difference is the serial pins in mbed_app.json and in some of the setting in custom_target.json. You might be onto something. Thanks

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

More
26 Oct 2021 23:25 #224445 by scotta

@scotta : Do you think it is possible to connect until 5 MCU like the rpspi.c driver ? or maybe start with 2, one on the RPI SPI0 and an another on the RPI SPI1

Definitely and this is something I had in the back of my mind. We could utilise SPI0 and have multiple Chip Selects.

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

More
27 Oct 2021 00:03 - 27 Oct 2021 00:38 #224448 by cakeslob
Sorry, I should specify I bit more. The skr2 works with the skr2, it was mostly a sanity check to make sure my cables/gpio/linuxcnc were not the root cause. I havent actually tried with just the skr2 firmware, I didnt really consider it but I will now. 
The only difference I am seeing between the 2 also, is just some pins and the clock. I find no other references that indicate any different compile flags among the other firmware. 
The only thing difference I noticed in klipper, is something with the bootloader and the clockspeed with a 12 Mhz clock reference but Im not sure what its referring to.
github.com/bigtreetech/BIGTREETECH-OCTOP...ter/Firmware/Klipper


I hooked up the octopus to mbed studio with a chinese stlinkv2 and it works and connects, but when trying to debug the program, it makes my computer go completely ape shit triggering mouse events all over the place.

look if ur connected to the right spi port.

they are all the same pretty much , on exp2, i checked a few times just incase
Last edit: 27 Oct 2021 00:38 by cakeslob.

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

More
27 Oct 2021 04:40 #224467 by scotta
Ok, I should have checked the clock frequency, rather than copying from another Mbed target. I've updated the develop repo with an updated system_clock.c and compiled bin file. Fingers crossed this was the issue.

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

More
27 Oct 2021 13:22 #224514 by gtt38
I saw your repo and i m gonna try to create my own target for stm32f411 this weekend

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

Time to create page: 0.175 seconds
Powered by Kunena Forum