- Hardware & Machines
- Computers and Hardware
- Remora - Rpi Software Stepping Using External Microcontroller via SPI
Remora - Rpi Software Stepping Using External Microcontroller via SPI
- 4170-thomasnobi
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
11 Jan 2023 14:33 #261574
by 4170-thomasnobi
Replied by 4170-thomasnobi on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
My hardware:
Rasperry Pi4 4Gb with the RT image.
Octopus Pro Board via SPI
JMC IHS57 Servos
Software:
LinuxCNC 2.8.3
Remora 1.1.0
Rasperry Pi4 4Gb with the RT image.
Octopus Pro Board via SPI
JMC IHS57 Servos
Software:
LinuxCNC 2.8.3
Remora 1.1.0
Please Log in or Create an account to join the conversation.
11 Jan 2023 16:45 #261588
by Aaroncnc
Replied by Aaroncnc on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
see page 51
www.st.com/content/ccc/resource/technica...ns/en.DM00141306.pdf
try a different timer pin
www.st.com/content/ccc/resource/technica...ns/en.DM00141306.pdf
try a different timer pin
Please Log in or Create an account to join the conversation.
12 Jan 2023 01:12 - 12 Jan 2023 01:13 #261649
by cakeslob
Replied by cakeslob on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
Hmm the stm32f407 has an extra channel for pwm compared to 429/446, so it didnt error because its a hardware pin for skr2/407 (but not skr2/429). how do i address this?
if you are just using the fan pins, use fan0, thats hooked up to pa8 which is a hardware pwm pin.
you can use these pins, taken from flexihal page
github.com/Expatria-Technologies/remora-...ers/pin/pin.cpp#L200
if you are just using the fan pins, use fan0, thats hooked up to pa8 which is a hardware pwm pin.
you can use these pins, taken from flexihal page
github.com/Expatria-Technologies/remora-...ers/pin/pin.cpp#L200
Last edit: 12 Jan 2023 01:13 by cakeslob.
Please Log in or Create an account to join the conversation.
- 4170-thomasnobi
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
12 Jan 2023 11:56 - 12 Jan 2023 12:15 #261681
by 4170-thomasnobi
Replied by 4170-thomasnobi on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
Thanks for the quick reply. The Octopus Pro board has the STM32F429. I have tested the following pins PA2, PA8, PA15, PE6, PE10. All these pins are assigned a TIM (see PeripheralPins.c -> PinMap_PWM). Software PWM signal OK, Hardware PWM no signal. in the file pwm.cpp the HardwarePWM is commented out.
// Hardware PWM
if (!strcmp(variable,"True"))
{
// Variable frequency hardware PWM
ptrSetPoint[period_sp] = &rxData.setPoint[period_sp];
//Module* pwm = new HardwarePWM(*ptrSetPoint[period_sp], *ptrSetPoint[sp], period, pin);
//servoThread->registerModule(pwm);
}
else
{
// Fixed frequency hardware PWM
//Module* pwm = new HardwarePWM(*ptrSetPoint[sp], period, pin);
//servoThread->registerModule(pwm);
}
Could this be the reason?
Boot serial out with HardwarePWM:
PWM Laser
Make PWM at pin PA_8
Boot serial out with SoftwarePWM:
Servo thread object
PWM Laser
Make PWM at pin PA_8
Creating a std module
Creating software PWM @ pin PA_8
Creating a std module
Creating Pin @
port = GPIOA
pin = 8
// Hardware PWM
if (!strcmp(variable,"True"))
{
// Variable frequency hardware PWM
ptrSetPoint[period_sp] = &rxData.setPoint[period_sp];
//Module* pwm = new HardwarePWM(*ptrSetPoint[period_sp], *ptrSetPoint[sp], period, pin);
//servoThread->registerModule(pwm);
}
else
{
// Fixed frequency hardware PWM
//Module* pwm = new HardwarePWM(*ptrSetPoint[sp], period, pin);
//servoThread->registerModule(pwm);
}
Could this be the reason?
Boot serial out with HardwarePWM:
PWM Laser
Make PWM at pin PA_8
Boot serial out with SoftwarePWM:
Servo thread object
PWM Laser
Make PWM at pin PA_8
Creating a std module
Creating software PWM @ pin PA_8
Creating a std module
Creating Pin @
port = GPIOA
pin = 8
Last edit: 12 Jan 2023 12:15 by 4170-thomasnobi.
Please Log in or Create an account to join the conversation.
12 Jan 2023 21:10 #261738
by scotta
Replied by scotta on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
Looks like you've found the issue. I don't think I've ever tested the hardware PWM on an STM32 board. The config error checking code is using LPC1768 pin assignments in the comment.
Worth uncommenting to see what happens...
Worth uncommenting to see what happens...
Please Log in or Create an account to join the conversation.
13 Jan 2023 01:19 #261765
by cakeslob
Replied by cakeslob on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
Looks like it probably hasnt been working for any target since the STM merge if thats the case
Heres the change
github.com/cakeslob/Remora/commit/212fd9...32d3bcd299846841fbbc
Here is new firmware to test if you dont mind, please do report back if it works
github.com/cakeslob/Remora/tree/6d52a12e...mwareBin/OCTOPUS_429
Heres the change
github.com/cakeslob/Remora/commit/212fd9...32d3bcd299846841fbbc
Here is new firmware to test if you dont mind, please do report back if it works
github.com/cakeslob/Remora/tree/6d52a12e...mwareBin/OCTOPUS_429
Please Log in or Create an account to join the conversation.
- 4170-thomasnobi
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
13 Jan 2023 10:20 #261787
by 4170-thomasnobi
Replied by 4170-thomasnobi on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
Thank you very much scotta and cakeslob for the good work.
Now the PWM is activated correctly.
I found a small difference in the notation of "Period US" (documentation) and "Period us" (source code).
With best regards Thomas
Now the PWM is activated correctly.
I found a small difference in the notation of "Period US" (documentation) and "Period us" (source code).
With best regards Thomas
Please Log in or Create an account to join the conversation.
19 Jan 2023 02:02 #262377
by cakeslob
Replied by cakeslob on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
cakeslob remora bulletin incoming
- remora driver for upboard
github.com/mrbubble62/UPBoard-Remora
github.com/mrbubble62/UPBoard-Remora/tre...C/Components/Upboard
the parts I understand is, I think hes using spidev and a modified UP RPI.GPIO, which could mean its not impossible to get this working with other sbc like rockchip or allwinner
- remora static config ( no sd card needed)
github.com/cakeslob/Remora/tree/static_config
the guys from Expatria-Technologies who are doin the flexi-hal, modified remora to use a static compiled config. I took that stuff and mashed it into regular remora. using mbed studio, you edit you config and compile it with your firmware and bingo, no sdcard. so far only stepgen, inputs/outputs and single pwm are supported (thats what was in flexihal). I also added blink, and i am trying to figure out the others. ive tested on the fystec spider, and nucleo-446 and so far results are good. i havent tested it yet with steppers connected. the firmware is almost small enough to fit on a bluepill f103 but i dont know how to get the firmware smaller.
- working on manta m8p target and had to upgrade to mbed6, so far it compiles at least. is there a specific reason remora is not mbed6? also bought a mks skipr with rockchip and 407.i forgot to check my notes before buying, so it will have sd card issues
github.com/cakeslob/Remora/tree/mbedos6
- remora driver for upboard
github.com/mrbubble62/UPBoard-Remora
github.com/mrbubble62/UPBoard-Remora/tre...C/Components/Upboard
the parts I understand is, I think hes using spidev and a modified UP RPI.GPIO, which could mean its not impossible to get this working with other sbc like rockchip or allwinner
- remora static config ( no sd card needed)
github.com/cakeslob/Remora/tree/static_config
the guys from Expatria-Technologies who are doin the flexi-hal, modified remora to use a static compiled config. I took that stuff and mashed it into regular remora. using mbed studio, you edit you config and compile it with your firmware and bingo, no sdcard. so far only stepgen, inputs/outputs and single pwm are supported (thats what was in flexihal). I also added blink, and i am trying to figure out the others. ive tested on the fystec spider, and nucleo-446 and so far results are good. i havent tested it yet with steppers connected. the firmware is almost small enough to fit on a bluepill f103 but i dont know how to get the firmware smaller.
- working on manta m8p target and had to upgrade to mbed6, so far it compiles at least. is there a specific reason remora is not mbed6? also bought a mks skipr with rockchip and 407.i forgot to check my notes before buying, so it will have sd card issues
github.com/cakeslob/Remora/tree/mbedos6
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
19 Jan 2023 05:12 #262382
by scotta
Replied by scotta on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
For the LPC1768 boards, MODDMA is needed, which unfortunately has not been migrate to Mbed OS6. I did have a go and got it kind of working but it was unstable. If we drop LPC1768 support, we could move to OS6.
We'd still suffer from bootloader issues which have not be solved for some boards STM32F and the SKR3.
We'd still suffer from bootloader issues which have not be solved for some boards STM32F and the SKR3.
Please Log in or Create an account to join the conversation.
19 Jan 2023 15:23 #262419
by cakeslob
Replied by cakeslob on topic Remora - Rpi Software Stepping Using External Microcontroller via SPI
Its like an issue with and because of the bootloader. I find the bootloader to be a smaller issue compared to sdcard because the boards still function without out the bootloader.
I spent a few weekends trying to debug SD on spider which uses spi, I can get as far as card initialization at an sd level(not remora), but the SD cant read any of the sd card CSD registers. tried lots of things with configuring/debugging the sdblockdevice but thats as far as I could get.
On MKS boards, it will at least load the config from the SD, but it cause an issuefor the next time it boots and the sdcard needs to be powercycled before it will work by either physically ejecting the card or doing 2 power cycles on the board (first power cycle doesnt work second one does)
One thing I saw while looking into it, and it seems to makes sense, was this from klipper
github.com/Klipper3d/klipper/pull/4885
This makes some sense because after a the bootloader successfully loads the firmware from SD, the spi busses shut down, so remora cannot load the config.txt or connect.
Sorry, the stuff gets out of my league very fast, but not for lack of trying.
I spent a few weekends trying to debug SD on spider which uses spi, I can get as far as card initialization at an sd level(not remora), but the SD cant read any of the sd card CSD registers. tried lots of things with configuring/debugging the sdblockdevice but thats as far as I could get.
On MKS boards, it will at least load the config from the SD, but it cause an issuefor the next time it boots and the sdcard needs to be powercycled before it will work by either physically ejecting the card or doing 2 power cycles on the board (first power cycle doesnt work second one does)
One thing I saw while looking into it, and it seems to makes sense, was this from klipper
github.com/Klipper3d/klipper/pull/4885
This makes some sense because after a the bootloader successfully loads the firmware from SD, the spi busses shut down, so remora cannot load the config.txt or connect.
Sorry, the stuff gets out of my league very fast, but not for lack of trying.
Please Log in or Create an account to join the conversation.
- Hardware & Machines
- Computers and Hardware
- Remora - Rpi Software Stepping Using External Microcontroller via SPI
Time to create page: 0.446 seconds