what is your IDE?modern IDEs have a feature usually named "data breakpoints" in contrast with "line breakpoint". A line breakpoint hits when the MCU arrives at the specified line. A databreak point hits when a specific memory location accessed (read/...
did you generate code for other IDEs before generating for CubeIDE?I had similar problem when generated project for Keil and then generated for cubeMX. Maybe starting a new clean project and adding your source helps.