To run GRBL firmware on the STM32 microcontroller, you’ll need to use grblHAL
Whey have a Webbuilder which makes the flashing process a little bit easier. (Though still not easy!) You will need to know the exact pinmap and some other variables.
The manufacturer of your board should be able to send you a pre-compiled .bin file of the firmware and give you instructions on how to flash it to the STM32.
I thought, you wanted to replace this board? Did you try to swap the stepper drivers?