Привет всем!
Есть два устройства на таком МК, одно вышло из строя (сгорел МК), хочу скопировать прошивку с одного на чистый МК.
Для этого купил на али адаптер USB
https://static.chipdip.ru/lib/139/DOC001139592.pdfЧерез Silicon labs IDE, меню Debug-Connect - МК видится, в меню Tools-Upload memory to file - сохранил все 3 вида кода (RAM, Code, External memory) в 3 файла.
Как теперь эти файлы записать в другой МК? Обратной операции в IDE не нашёл
(
Читал про другие LPT адаптеры, но хочется же через тот девайс USB, неужели он не умеет писать в этот МК?
Нашёл ещё Flash Utility - она подключается к МК, но не воспринимает файлы, которые я получил из IDE - пишет "not hex format".
Хотя я же указываю в IDE, что hex (см. рисунок).
Подскажите для чайника, пожалуйста.
Добавлено after 5 hours 41 minute 51 second:Отвечаю сам себе
может, ещё кому-то пригодится.
В утилите Silicon Labs IDE сливаем прошивку (блок CODE) в текстовый файл и ставим крыжик hex.
Получаем текстовый файл, в котором каждый байт на новой строчке идёт. Странно, зачем так сделали.
GUI утилитой ASC2HEX.exe преобразовываем этот файл в файл .bin
Далее идём на 32-разрядную винду, и с помощью командной утилиты BIN2HEX.EXE преобразуем .bin в .hex
И уже затем Flash Programming Utility (в яндексе находится легко) в разделе Download hex File/Go/Stop выбираем этот .hex и жмём Download.
У меня получилось
Архив с утилитками прикладываю здесь.
А гады silicon labs закрыли регистрацию для России (и Кубы) - но там есть их статья, по которой и делал (пришлось региться через vpn)
How can I copy firmware from one device to another?
mportant note: The following procedure will work only if the device's code memory is not locked i.e. the lock byte(s) should be 0xFF. To protect your intellectual property and prevent such copying, you can lock the code memory by writing to the lock byte(s). Please refer to the device data sheet for security options. Also see the article 'Locking Code Memory' in the 'Related Articles' section.
This procedure is to copy firmware that is up to 64 kB in length.
1. Open the Silicon Laboratories IDE, set the right options in the 'Tools > Connection Options' menu, and choose 'Debug > Connect'.
2. Choose 'Tools > Upload Memory to File', and select the Memory Type as 'CODE'. Also select the address range that you want to copy.
3. Browse to a folder using the 'Browse' button and type-in a new file name (eg: Code1.txt) to save the uploaded memory.
4. Choose 'Go' to upload the Flash memory from the device to the file in ASCII format.
4. Use the 'ASC2HEX.exe' utility attached to this article to convert the ASCII file to a *.BIN file.
5. Use the Keil 'BIN2HEX.exe' command line utility attached to this article to convert the *.BIN file to a Intel HEX file (*.hex).
Usage example: BIN2HEX CRobot tonguerojectsprj1Code1.bin
Note: BIN2HEX.exe is not compatible with Windows 64-bit operating systems. Please use a Windows 32-bit operating system.
This article shows how to copy using the IDE. The same procedure can be followed to copy using the Flash Programming Utilities as well.
- Вложения
-
- ASC2HEX_v1.1.zip
- (15.75 KiB) Скачиваний: 151
-
- code.jpg
- (45.19 KiB) Скачиваний: 886