- /* The length of the copy (R2) */
- buf_set_u32(reg_params[2].value, 0, 32, this_count / 4);
+ /* The number of half pages to copy (R2) */
+ buf_set_u32(reg_params[2].value, 0, 32, this_count / hp_nb);
+ /* The size in byes of a half page (R3) */
+ buf_set_u32(reg_params[3].value, 0, 32, hp_nb);
+ /* The flash base address (R4) */
+ buf_set_u32(reg_params[4].value, 0, 32, stm32lx_info->flash_base);