finished the programmer
This commit is contained in:
		@@ -62,12 +62,13 @@ int main(void)
 | 
			
		||||
  sprintf(manufacturer, "0x%02X \r\n", man_id);
 | 
			
		||||
  sprintf(device, "0x%02X \r\n", dev_id);
 | 
			
		||||
 | 
			
		||||
  debug_print("==========================================\r\n");
 | 
			
		||||
  debug_print("Manufacturer ID = \r\n");
 | 
			
		||||
  debug_print(manufacturer);
 | 
			
		||||
  debug_print("Device ID = \r\n");
 | 
			
		||||
  debug_print(device);
 | 
			
		||||
  debug_print("==========================================\r\n");
 | 
			
		||||
  debug_print("=====================================================================================\r\n");
 | 
			
		||||
  debug_print(" _____ _____ _____ _____ _____ _____\r\n");
 | 
			
		||||
  debug_print("|   __|   __|  _  | __  |     |     |   ___ ___ ___ ___ ___ ___ _____ _____ ___ ___\r\n");
 | 
			
		||||
  debug_print("|   __|   __|   __|    -|  |  | | | |  | . |  _| . | . |  _| .'|     |     | -_|  _|\r\n");
 | 
			
		||||
  debug_print("|_____|_____|__|  |__|__|_____|_|_|_|  |  _|_| |___|_  |_| |__,|_|_|_|_|_|_|___|_|\r\n");
 | 
			
		||||
  debug_print("    - Ayabusa 2025                     |_|         |___|\r\n");
 | 
			
		||||
  debug_print("=====================================================================================\r\n");
 | 
			
		||||
 | 
			
		||||
  /* Infinite loop */
 | 
			
		||||
  while (1)
 | 
			
		||||
@@ -75,7 +76,9 @@ int main(void)
 | 
			
		||||
    debug_print("Hello welcome to the EEPROM programmer! What would you like to do?\r\n");
 | 
			
		||||
    debug_print("[1] Dump Rom as char\r\n");
 | 
			
		||||
    debug_print("[2] Erase chip\r\n");
 | 
			
		||||
    debug_print("[3] Program chip via UART\r\n");
 | 
			
		||||
    debug_print("[3] Program chip via UART (ASCII mode)\r\n");
 | 
			
		||||
    debug_print("[4] Identify device\r\n");
 | 
			
		||||
    debug_print("[5] Dump Rom as file (ASCII mode)\r\n");
 | 
			
		||||
    uint8_t resp;
 | 
			
		||||
    HAL_UART_Receive(&huart2, &resp, 1, HAL_MAX_DELAY);
 | 
			
		||||
 | 
			
		||||
@@ -93,6 +96,19 @@ int main(void)
 | 
			
		||||
      debug_print("Launching programming sequence...\r\n");
 | 
			
		||||
      Flash_From_UART();
 | 
			
		||||
      break;
 | 
			
		||||
    case 0x34:
 | 
			
		||||
      debug_print("Identifying device...\r\n");
 | 
			
		||||
      debug_print("Manufacturer ID = \r\n");
 | 
			
		||||
      debug_print(manufacturer);
 | 
			
		||||
      debug_print("Device ID = \r\n");
 | 
			
		||||
      debug_print(device);
 | 
			
		||||
      break;
 | 
			
		||||
    case 0x35:
 | 
			
		||||
      debug_print("Dumping ROM as file, press any key...\r\n");
 | 
			
		||||
      uint8_t byte;
 | 
			
		||||
      HAL_UART_Receive(&huart2, &byte, 1, HAL_MAX_DELAY);
 | 
			
		||||
      Dump_Flash_UART(0);
 | 
			
		||||
      while(1){}
 | 
			
		||||
    default:
 | 
			
		||||
      debug_print("Invalid input!\r\n");
 | 
			
		||||
      break;
 | 
			
		||||
@@ -197,7 +213,7 @@ void Dump_Flash_UART(int visual_format){
 | 
			
		||||
  uint8_t byte;
 | 
			
		||||
  char buf[8];
 | 
			
		||||
 | 
			
		||||
  for (int addr = 0; addr < 0x80000; addr++) { // 512 KB
 | 
			
		||||
  for (int addr = 0; addr < 0x7FFFF; addr++) { // 512 KB
 | 
			
		||||
    byte = Flash_ReadByte(addr);
 | 
			
		||||
 | 
			
		||||
    if(visual_format==0){
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user