How do I read and write data to a STM32f746 board


I am fairly new to Rust and I am currently working on an assignment for my internship. I am trying to write data (text) into the memory of a NUCLEO-STM32F746 and read it afterwards. I got this far but I have no idea if I am on the right track and where I am going wrong:

use core::panic::PanicInfo;
use stm32f7xx_hal::{self, flash};

fn main() {
    // Get access to the device peripherals
    let dp = stm32f7xx_hal::pac::Peripherals::take().unwrap();

    // Configure the Flash peripheral
    let mut flash = stm32f7xx_hal::flash::Flash::new(dp.FLASH);

    // Define the address and data to write
    let address: usize = 0x0800_0000; // Start of main memory
    let data = [0xAB, 0xCD, 0xEF];
    let sector_number = 1;

    // Unlock the flash for writing

    // Erase the flash sector containing the address

    // Write the data to flash
    flash.program(usize::from(address), &data).unwrap();

    // Lock the flash

    // Perform a software reset

fn panic(_panic: &PanicInfo<'_>) -> ! {
    loop {}

Thanks in advance!!