It is looking much better. Some more comments: 1. I'd remove comments such as the below though.
+ // Create the bank structure + stm32lx_info = malloc(sizeof(struct stm32lx_flash_bank)); + + // Check allocation + if (stm32lx_info == NULL) 2. Missing error check: target_read_u32 3. missing error check: stm32lx_wait_until_bsy_clear 4. Resource leakage: + // Lock back program memory + retval = stm32lx_lock_program_memory(bank); + if (retval != ERROR_OK) + return retval; + + // Free the working areas + target_free_working_area(target, source); + target_free_working_area(target, stm32lx_info->write_algorithm); + + // Destroy the registers + destroy_reg_param(®_params[0]); + destroy_reg_param(®_params[1]); + destroy_reg_param(®_params[2]); + destroy_reg_param(®_params[3]); + + return retval; +} 5. Bug: + // Wait for busy clear + retval = stm32lx_wait_until_bsy_clear(bank); + return retval; -- Øyvind Harboe - Can Zylin Consulting help on your project? US toll free 1-866-980-3434 http://www.zylin.com/ _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
