Skip to content

Unknown Cortex-M core on embassy-stm32::hsem::get_current_coreid() using an stm32h755 #4180

Description

@Ragarnoy

I'm trying to use hardware semaphores on the nucleo H755ZI-Q, sadly it seems there might be an issue with how hardware semaphores are implemented, my core id does not match the accepted core ids defined in the codebase basically

Plainly put:

    let cpuid = unsafe { cortex_m::peripheral::CPUID::PTR.read_volatile().base.read() };
    info!("CM7: CPUID=0X{:x}", cpuid & 0x000000F0);

gives me INFO CM7: CPUID=0X70
however get_current_core_id() only allows those values, or panics

pub fn get_current_coreid() -> CoreId {
    let cpuid = unsafe { cortex_m::peripheral::CPUID::PTR.read_volatile().base.read() };
    match cpuid & 0x000000F0 {
        #[cfg(any(stm32wb, stm32wl))]
        0x0 => CoreId::Core1,

        #[cfg(not(any(stm32h745, stm32h747, stm32h755, stm32h757)))]
        0x4 => CoreId::Core0,

        #[cfg(any(stm32h745, stm32h747, stm32h755, stm32h757))]
        0x4 => CoreId::Core1,

        #[cfg(any(stm32h745, stm32h747, stm32h755, stm32h757))]
        0x7 => CoreId::Core0,
        _ => panic!("Unknown Cortex-M core"),
    }
}

Unless I'm using this feature incorrectly, this seems like a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions