MCZ 0 11 октября, 2010 Опубликовано 11 октября, 2010 (изменено) · Жалоба Подскажите, плиз: Есть evaluation Board, на нем HC908-JB16. Работает под USB, на плате реализован монитор через RS232. Прошивку лью через ICP. Пытаюсь отладиться через дебаг монитр MON08, питание взято от того же USB, В обычном режиме устройство детектится нормально, драйвер становится и т.п. А при подключении через дебаг монитор, стартую прошивку, но коммуникации с портом USB на компьютере не происходит. При включении компьютер видит устройство с нулевыми дескрипторми, и это понятно, ведь запускается сам монитор, а не прошивка. Т.е. инициализация со стороны компьютера проходит неверно. Как правильно в режиме отладки стартануть устройство, чтобы компьютер начал взаимодействовать с устройство в обычном режиме, и можно было бы в отладчике установить брекпоинт на точке входа и дальше уже отладиться. Со стороны компьютера, устройство первоначально подключается в режиме пустышки, получается, т.е. толко питание берется, а обмена нет. А дальше, при старте прошивки, компьютер уже не ждет обмена от устройства, и соответственно, подвисает устройство. Есть мысль запитать схему от другого источника, затем войти в режим монитора, установить брекпойин и затем уже воткнуть USB в компьютер, при этом пойдет запрос на инициализацию устройства и должна начать выполняться прошивка внутри, как минимум должен прийти запрос дескриптора. Есть ли какие-то тонкости реализации такого режима отладки или надо купить плату для внутрисхемной отладки нормальную. спасибо. Изменено 11 октября, 2010 пользователем MCZ Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться
DmitryM 0 11 октября, 2010 Опубликовано 11 октября, 2010 · Жалоба Подскажите, плиз: Есть evaluation Board, на нем HC908-JB16. Работает под USB, на плате реализован монитор через RS232. А есть возможность передернуть PullUp на линиях USB??? Тем самым Вы скажете ПК заново проинициализировать USB-Device. Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться
MCZ 0 11 октября, 2010 Опубликовано 11 октября, 2010 (изменено) · Жалоба А есть возможность передернуть PullUp на линиях USB??? Тем самым Вы скажете ПК заново проинициализировать USB-Device. Могу поставить микрик туда, попробовать: То бишь мы имитируем ситуация, которая выделена ниже..... 1. The hub (or root hub) where the device is attached informs the host that an event has occurred. There are two 15K pull down resistors connected to the D+ and D- USB wires in the hub port or root hub in the host. When the device is attached, its pull-up resistor (see USB Mechanical and Electrical section) will cause the signal level of either D+ or D- to rise, thereby signaling the attachment of a USB device. The device is now considered to be in the attached stage 2. The host inquires the hub regarding the nature of the event. 3. The host issues a "port enable and reset" command to the hub where the device is attached. 4. The hub will then issue a USB reset signal to that port for 10 ms and provide 100 mA of power supply to the device after the reset signal is completed. The device now is considered to be in the powered stage, as shown in Figure 2-14. From the device point of view, the reset signal is the first signal it sees when it is attached to the hub or root hub. After the reset signal, the device is in its default stage, where it corresponds to the host with its default address (address 0 and endpoint 0). 5. The host will then initiate a GET DESCRIPTOR ("device" descriptor type) setup packet to the device, and the device needs to respond accordingly. Могу поставить микрик туда, попробовать: То бишь мы имитируем ситуация, которая выделена ниже..... 1. The hub (or root hub) where the device is attached informs the host that an event has occurred. There are two 15K pull down resistors connected to the D+ and D- USB wires in the hub port or root hub in the host. When the device is attached, its pull-up resistor (see USB Mechanical and Electrical section) will cause the signal level of either D+ or D- to rise, thereby signaling the attachment of a USB device. The device is now considered to be in the attached stage 2. The host inquires the hub regarding the nature of the event. 3. The host issues a "port enable and reset" command to the hub where the device is attached. 4. The hub will then issue a USB reset signal to that port for 10 ms and provide 100 mA of power supply to the device after the reset signal is completed. The device now is considered to be in the powered stage,. From the device point of view, the reset signal is the first signal it sees when it is attached to the hub or root hub. After the reset signal, the device is in its default stage, where it corresponds to the host with its default address (address 0 and endpoint 0). 5. The host will then initiate a GET DESCRIPTOR ("device" descriptor type) setup packet to the device, and the device needs to respond accordingly. Дык, а по 4 пунку, если шина отресетит контроллер, не сбросится ли хардварный брекпоинт при этом? Монитор не слетает при софтовом ресете, а вот бряк может слететь. Судя по даташиту, The break address registers (BRKH and BRKL) contain the high and low bytes of the desired breakpoint address. Reset clears the break address registers. Изменено 11 октября, 2010 пользователем MCZ Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться
DmitryM 0 12 октября, 2010 Опубликовано 12 октября, 2010 · Жалоба Могу поставить микрик туда, попробовать: То бишь мы имитируем ситуация, которая выделена ниже..... 4. The hub will then issue a USB reset signal to that port for 10 ms and provide 100 mA of power supply to the device after the reset signal is completed. The device now is considered to be in the powered stage, as shown in Figure 2-14. From the device point of view, the reset signal is the first signal it sees when it is attached to the hub or root hub. After the reset signal, the device is in its default stage, where it corresponds to the host with its default address (address 0 and endpoint 0). Дык, это команда (Reset) для приведения USB-стайт-машины в исходное состояние. Зачем же Вам сбрасывать весь микроконтроллер. Цитата Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты Поделиться