Как прошить через OpenOCD

Про байтики и логику ЭБУ
Post Reply
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Как прошить через OpenOCD

Post by AndreyB »

А ведь OpenOCD - он еще и универсальный прошивальщик по сути?
Кажется он должен прошить командой

Code: Select all

openocd-0.8.0.exe -f interface/stlink-v2.cfg -f board/stm32f4discovery.cfg -c init -c targets -c "halt" -c "flash write_image erase build/rusefi.elf" -c "verify_image firmware.elf" -c "reset run" -c shutdown
но что-то идёт не так:

Image
Если кто-то сможет помочь с более правильной командой - я встрою OpenOCD прямо в dev console https://sourceforge.net/p/rusefi/tickets/108/
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Как прошить через OpenOCD

Post by AndreyB »

Вопрос всё еще актуален - я с чёртовыми платами вожусь пока и другим программированием, очень бы помогло если бы кто-то разобрался.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
meXanicus
contributor
contributor
Posts: 314
Joined: Sat Dec 21, 2013 2:42 pm
Location: Russia, Rostov-na-Donu

Re: Как прошить через OpenOCD

Post by meXanicus »

У меня OpenOCD прошивает дискавери. Комманда твоя:

Code: Select all

openocd-0.8.0.exe -f interface/stlink-v2.cfg -f board/stm32f4discovery.cfg -c "init" -c "targets" -c "halt" -c "flash write_image erase rusefi.elf" -c "verify_image rusefi.elf" -c "reset run" -c "shutdown"
Ошибка как у тебя на скрине у меня возникает когда запущен "STM32 ST-LINK Utility". Причем достаточно просто запустить программу и не подключать к дискавери (connect to the target)
Я на Drive2 Alfa Romeo 156 SW
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Как прошить через OpenOCD

Post by AndreyB »

Спасибо! Ты очень помог.

Оказывается rusefi.elf из Eclipse в режиме Debug не прошивается - я пробовал только этот файл. А ты меня заставил попробовать rusefi.elf который идёт на build_server без Debug - и он прошился.

Файл из Eclipse в режиме Debug видимо слишком большой, он в 3 раза больше файла с build_server

Вопрос закрыт, значит сделаю прошивку прямо кнопкой в консоли! Попробую во всяком случае :)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: Как прошить через OpenOCD

Post by puff »

это потянет за собой dependency в виде openocd? как насчет кросплатформенности консоли?
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Как прошить через OpenOCD

Post by AndreyB »

это потянет за собой openocd for windows. на других платформах этой кнопки пока не будет
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Как прошить через OpenOCD

Post by AndreyB »

Блин, там очень забавный глюк: сделал в новой консоли кнопку, которая вызывает openocd. Эта штука прошивает ЧЕРЕЗ РАЗ. Нажал 10 раз - каждый второй раз работает, остальные разы - ошибка какая-то. Видимо команду можно как-то улучшить.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: Как прошить через OpenOCD

Post by puff »

каждый четный, или по-разному? а то дважды команду отправлять - и делов-то (может там shutdown играет роль?)
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Как прошить через OpenOCD

Post by AndreyB »

Ровно через раз, что в каком-то смысле радует. Да, можно пока пережить - но всё-таки лучше поправить flash_openocd.bat
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Как прошить через OpenOCD

Post by AndreyB »

В итоге заработало каждый раз вот такой командой:
openocd-0.8.0.exe -f interface/stlink-v2.cfg -f board/stm32f4discovery.cfg -c "program rusefi.bin verify reset exit 0x08000000"
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14323
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Как прошить через OpenOCD

Post by AndreyB »

stm32f4discovery.cfg заменился на stm32f429disc1.cfg - новые платы (и вероятно старыне платы с последней прошивкой) теперь по более свежей версии st-link протокола прошиваются.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Post Reply