scottalford75 / Remora

Remora is a free, opensource LinuxCNC component and Programmable Realtime Unit (PRU) firmware to allow LPC176x and STM32F4 micro-controller controller boards to be used in conjunction with a Raspberry Pi to implement a LinuxCNC based CNC controller.
126 stars 32 forks source link

Installation instructions for RPi 4 not working #39

Open dmason1992 opened 1 year ago

dmason1992 commented 1 year ago

Hi,

I've been trying to follow the installation instruction for the RPi4. (4gb brand new model) from here

steps 1-6 go fine.

step 7 - I can modify /boot/config.txt fine using nano and save changes. First time running through the steps I didn't do a reboot after this because it didn't say to and I continued onto step 8. After not successfully installing the image during step 8 I figured I had missed a step by not rebooting here so that the memory setting had a chance to take effect. After making this change the pi will no longer boot and just gets stuck at the rainbow screen

step 8 - Command runs fine for a while until it hits an error Errors were encountered while processing: /var/cache/apt/archives/linux-image-4.19.71-rt24-v7l+_4.19.71-rt24-v7l+-4_armhf.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

Any advice on what I need to do?

scottalford75 commented 1 year ago

The instructions are a little old now. Have a look at

https://forum.linuxcnc.org/9-installing-linuxcnc/47841-installing-linuxcnc-2-8-4-on-raspbian-10-buster-tested-on-raspberry-pi-3b-pi#260915

dmason1992 commented 1 year ago

Those instructions also caused it to be frozen on a rainbow screen. Someone on the discord sent me a working image with it pre-installed!

Now to add remora on top

dmason1992 commented 1 year ago

This is the link to the image that worked for me. https://drive.google.com/file/d/1Vgj2rMgG_gdNWx_5OKJco115P56dgIx4/view?usp=sharing

I have installed remora now following your instructions for those steps.

@scottalford75 Do you happen to have a firmware.bin file for STM32F407? Or some guidance on how to compile one using mbed studio (little bit over my head here as the closest i've ever got was just using klippers commands to generate bin files)

I really want to promote the use of linuxCNC for the Millennium Mill cnc project so I am willing to help update docs etc. if this project is still active?

dmason1992 commented 1 year ago

I used SKRv2 bin file.

I seems to have flashed - I'm assuming this sets the serial link to the one on the header and not USB because the usb port disappears? I can wire up that port to rpi at some point this week and see if I have communication or not!

cakeslob commented 1 year ago

What board are you trying to use? SKR2 bin will have specific pins tied to SDIO for sdcard, spi on PA,4,5,6,7 and UART on PA9,10

dmason1992 commented 1 year ago

I am trying to use the Spider King board from FYSETC with the STM32F407 module

cakeslob commented 1 year ago

Ok, Ive had my eye on this board for a while, but I dont yet have it. The SKR2 firmware wont work but it wont mess it up. There are a few things different. I will spin up for this board in the evening, in the meantime, if you can make and post a config.txt file for the board and we can use it in to make a spider king sample configuration.

dmason1992 commented 1 year ago

Ooo excellent I will do that. I am out climbing this evening and then away with business tomorrow though so I likely won't get a chance to do this until Friday

cakeslob commented 1 year ago

Here is a thing you can test. It didnt come out the way I want it, but that will take longer, Here is the pinout. the board is pretty close to the regular spider, so they have a similar config. Here is the pinout stuff and bin file, I would rather use the rpi header but that will need work. https://github.com/cakeslob/Remora/tree/mbedos6/Firmware/FirmwareBin/SPIDER_KING

Spider King_V1 0_Pinout_remo

dmason1992 commented 1 year ago

That is awesome I will test on Friday!

Out of curiosity how on earth does one go about setting up everything like you have? And what makes using the rpi header for the spi harder? (because I'd agree it would be the neatest solution!)

Get Outlook for Androidhttps://aka.ms/ghei36


From: cakeslob @.> Sent: Thursday, February 9, 2023 4:30:44 AM To: scottalford75/Remora @.> Cc: dmason1992 @.>; Author @.> Subject: Re: [scottalford75/Remora] Installation instructions for RPi 4 not working (Issue #39)

Here is a thing you can test. It didnt come out the way I want it, but that will take longer, Here is the pinout. the board is pretty close to the regular spider, so they have a similar config. Here is the pinout stuff and bin file, I would rather use the rpi header but that will need work. https://github.com/cakeslob/Remora/tree/mbedos6/Firmware/FirmwareBin/SPIDER_KING

[Spider King_V1 0_Pinout_remo]https://user-images.githubusercontent.com/48161948/217718277-f3eaee93-9555-48df-b606-cbcbb79cb6fc.jpg

— Reply to this email directly, view it on GitHubhttps://github.com/scottalford75/Remora/issues/39#issuecomment-1423617853, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADAKEGEJTFPUOUOBZ7PKSGDWWRXHJANCNFSM6AAAAAAURPEZTY. You are receiving this because you authored the thread.Message ID: @.***>

dmason1992 commented 1 year ago

Here is a thing you can test. It didnt come out the way I want it, but that will take longer, Here is the pinout. the board is pretty close to the regular spider, so they have a similar config. Here is the pinout stuff and bin file, I would rather use the rpi header but that will need work. https://github.com/cakeslob/Remora/tree/mbedos6/Firmware/FirmwareBin/SPIDER_KING

Spider King_V1 0_Pinout_remo

I have flashed this onto the SD card and wired as per your diagram (Serial and SPI). I have a flashing red led on the king core board (approx 1hz). I can't see serial and i'm not sure how to test SPI is connected

cakeslob commented 1 year ago

Honestly. I would have been more surprised if it did work first time. Check a few things for me if you dont mind, These are the little mistakes I usually make when testing

  1. On the SD card. did the firmware.bin turn into FIRMWARE.CUR ? yes is good.
  2. Check baudrate , we run it at 115200, make sure RPI is enabled for serial (raspi-config), probably serial dev/AMA0 or something
  3. if you are powering from USB only, you need to do the USB power jumper thing
  4. SD cards, I am constantly fighting with SD cards, if firmware.bin did not turn into FIRMWARE.CUR, try with several various SD cards, from like 128mb to 8gb.

And what makes using the rpi header for the spi harder?

Its not exactly hard (probably), its just the SPI comms section uses a standard pinout for STM32F4, which is SPI1 on pins PA 5,6,7, this is hard coded in the F4 comms driver. The spider king is using SPI2 on the RPI header. Not exactly hard to change, but I will need to think how to make it work for both, or have a separate one for just spider king. I just dont know how to do either option yet.

i'm not sure how to test SPI is connected

me neither, I usually just load linuxcnc and try it. Aside from making sure I have the colours connected properly I dont know how to test it,. Open linuxcnc in terminal, and try to get out of estop. If you get SPI BAD PAYLOAD =0 , it might be firmware/connection related If you get SPI BAD PAYLOAD =3322x23 (or something like that) , its probably something between the firmware and linuxcnc like the cable (too long or other) or the remora driver something for STM32 probably download the stuff from the develop repo rpi

It will be a few weeks before I mine arrives , but this one doesnt seem too complicated ( I say that every time though)

cakeslob commented 1 year ago

Out of curiosity how on earth does one go about setting up everything like you have?

keep in mind, im a big idiot , this is more an attempt to spur interest for others with remora We need to find a few core components needed to run remora

For the Spider King, I looked at the IO, and what was connected were. The spider/s6 use pretty much the same pins but a different chip. When I setup the spider initially, Scott did the hard parts for me, so it was already mostly setup for the king version. There is more to it than that, but it is really hard computer shit I dont understand, but sometimes I can make boards work. So hopefully once I get the board and figure out this computer hacking, we can have a nice clean single ribbon cable version.

dmason1992 commented 1 year ago

mine actually changed to old.bin

image

spi and serial enabled

I can't see a serial port appear or connect to one when plugged in via the usb or via the raspberry pi header

I can't get out of estop mode in linuxcnc (Presume this is using the spi checks in the estop section to determine if the connection is still live - which suggests it is not)

If i enter DFU mode I can get a usb device to appear via the usb connection so the MCU is fine.

cakeslob commented 1 year ago

yeah I forgot fysetc does old.bin, so thats a good sign hmm guess I got cocky because its 407, ok then, back to basics, lets try hello world with just serial pa9/10

dmason1992 commented 1 year ago

Hi @cakeslob any chance your board arrived yet and you could send me a backup of the stock board memory? I seem to have killed the ability to load firmware via the SD card now and none of the firmware options I try to load via the DFU mode seem to work.

dmason1992 commented 1 year ago

Oh also USB is on pa11/12 according to their docs?

image

dmason1992 commented 1 year ago

Good news Fysetc sent me a hex file that i uploaded using the DFU which revived the board (returned it to factory state) - I was able to get the marlin & klipper .bin files onto it and the serial port via USB appears.

Neither of the ones from your repository @cakeslob worked.

cakeslob commented 1 year ago

sorry dmason, I didnt think you were still interested ,and I missed your posts because they were buried in this issue thread.

For the past month I was busy working on a remora presentation for the linuxcnc meeting that recently passed, as well as trying to get the documents and repos in order in time for the event.

Since the last time we talked, there were developments that include using the SPI2 , so we can make a cleaner version that we both desire.
If you are still interested, bear with me and I will whip up a working version for you. Im still going through the fallout that came from the meeting, but I will get back to you soon with a working version.

dmason1992 commented 1 year ago

Hi again!

Sorry things went quiet because I was busy building the actual cnc and didn't have time to test further!

I shall send you a pm as I am really keen to get this working and happy to contribute/bring in other more experienced software people from the Millennium Mill team to help out!

Dave

Get Outlook for Androidhttps://aka.ms/ghei36


From: cakeslob @.> Sent: Wednesday, April 26, 2023 2:29:27 AM To: scottalford75/Remora @.> Cc: dmason1992 @.>; Author @.> Subject: Re: [scottalford75/Remora] Installation instructions for RPi 4 not working (Issue #39)

sorry dmason, I didnt think you were still interested ,and I missed your posts because they were buried in this issue thread.

For the past month I was busy working on a remora presentation for the linuxcnc meeting that recently passed, as well as trying to get the documents and repos in order in time for the event.

Since the last time we talked, there were developments that include using the SPI2 , so we can make a cleaner version that we both desire. If you are still interested, bear with me and I will whip up a working version for you. Im still going through the fallout that came from the meeting, but I will get back to you soon with a working version.

— Reply to this email directly, view it on GitHubhttps://github.com/scottalford75/Remora/issues/39#issuecomment-1522633107, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADAKEGEMLCHNQFKXL6AD5LLXDB27PANCNFSM6AAAAAAURPEZTY. You are receiving this because you authored the thread.Message ID: @.***>