O boy, I’m afraid it is really messed up now.
Jack, STLink is hardware dongle to flash/debug STM32 chips. Get one if you want less painful recovery from hosed boot loader.
First tell me the truth, did you try to upload bin with some other/Linux uploader? I’ve tried to flash that BIN to Blue Pill and it never run. I did warn about that. But flashed with Uploader app to JL1 it runs - no problem.
I can try to dump the flash, if it is not locked, then it might be possible to restore. I will try and let you know.
Now, compiling from the source:
pin map is different. I have moved all pins around - no problem, except PWM . That is stubbornly non-functional on B0. Everything else, including motors, remapped with no issues.
If you managed to remap successfully, especially Spindle Speed pin - please let me know how you managed to do “partial remap” for TIM1.
Below is my map for JL1:
// Port A === Port B
// 0 X_STEP_BIT===
// 1 Y_STEP_BIT===
// 2 Z_STEP_BIT===
// 3 X_DIRECTION_BIT === COOLANT_FLOOD_BIT
// 4 Y_DIRECTION_BIT === COOLANT_MIST_BIT
// 5 Z_DIRECTION_BIT === CONTROL_RESET_BIT
// 6 STEPPERS_DISABLE_BIT === CONTROL_FEED_HOLD_BIT
// 7 === CONTROL_CYCLE_START_BIT
// 8 SPINDLE_PWM_BIT === CONTROL_SAFETY_DOOR_BIT
// 9===
// 10 === X_LIMIT_BIT
// 11 === Y_LIMIT_BIT
// 12 === Z_LIMIT_BIT
// 13 14 ======SWD SPINDLE_ENABLE_BIT
// 14 SPINDLE_DIRECTION_BIT
// 15 PROBE_BIT
// JL1 Laser Controller
// Port A ===Port B
// 0 COOLANT_FLOOD_BIT/Pointer === SPINDLE/LASER_PWM_BIT
// 1 COOLANT_MIST_BIT (unused) === reserved (boot1)
// 2 reserved for UART2/ESP ===
// 3 reserved for UART2/ESP ===
// 4 X_DIRECTION_BIT ===
// 5 MOTOR_ENABLE_BIT ===
// 6 Y_DIRECTION_BIT ===
// 7 BUTTON ===
// 8 ? === Y_STEP_BIT
// 9 reserved for UART1 === X_STEP_BIT
// 10 reserved for UART1 === reserved for UART3
// 11 X_LIMIT_BIT (USB) === eserved for UART3
// 12 Y_LIMIT_BIT (USB) ===CS eeprom
// 13 reserved (link SWDIO) === CLK eeprom
// 14 reserved (link SWCLK) ===MISO eeprom
// 15 ?===MOSI eeprom