Author Topic: USBDM programming issue with S08 micros  (Read 691 times)

0 Members and 1 Guest are viewing this topic.

Offline CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
USBDM programming issue with S08 micros
« on: December 13, 2023, 04:48:06 am »
Been using the USBDM programming adapter and for the most part it has been great. One issue I found when programming S08PA and S08FL micros is about 50% of the time the following error message appear - “Connection with the target has failed. Please cycle power to the target. Retry connection? Y/N”

Cycling the power to the mcu generally fixes the problem. The thing is, it only happens with a micro that has never been programmed. Once it has been programmed at least once it never happens again. This is not a problem for software development because of course the micro get programmed again and again, but for production usage it can be a bit of a drag. I have programmed about 5000 micros with it, so I have had to cycle the power a LOT.

BDM firmware version 4.12.1
DLL version 4.12.1.320
Running on Linux Mint Mate 20.3
Kernel 5.4.0-169

 

Offline pgo

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: USBDM programming issue with S08 micros
« Reply #1 on: December 13, 2023, 10:34:16 am »
Hi,

You have not given the hardware version you are using so it makes it difficult to be definitive.

Unfortunately, some 9s08 devices cannot be guaranteed to be forced into BDM mode except by a power-on-reset i.e. cycling the power while holding the BGND pin low.

If the hardware you are using does not have a controlled target power supply it may be necessary to manually cycle the power while the BDM keeps BGND low.

The second method given below is NOT guaranteed to work as it is possible on some devices to disable the BGND pin defeating programming.  I'm a bit surprised that it happens with blank devices but it may be timing related e.g. a watchdog or illegal instruction reset occurs before the BDM can make a connection and halt the target.

bye

From 9s08 manual:
The method for forcing active background mode depends on the specific HCS08
derivative
. For the 9S08xxxx, you can force active background after a power-on reset by
holding the BKGD pin low as the device exits the reset condition. You can also force
active background by driving BKGD low immediately after a serial background
command that writes a one to the BDFR bit in the SBDFR register. Other causes of reset
including an external pin reset or an internally generated error reset ignore the state of the
BKGD pin and reset into normal user mode. If no debug pod is connected to the BKGD
pin, the MCU will always reset into normal operating mode.
« Last Edit: December 13, 2023, 10:38:13 am by pgo »
 

Offline CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
Re: USBDM programming issue with S08 micros
« Reply #2 on: December 13, 2023, 10:38:09 am »
How would I determine which hardware version I am using?
 

Offline pgo

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: USBDM programming issue with S08 micros
« Reply #3 on: December 13, 2023, 10:40:35 am »
There is a table on the page below of the official versions.
https://usbdm.sourceforge.io/USBDM_V4.12/html/index.html
most of the ones on ebay etc are modifications of the USBDM_JS16CWJ version.
bye

PS. you could post a picture of the PCB.
 

Offline CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
Re: USBDM programming issue with S08 micros
« Reply #4 on: December 13, 2023, 11:25:50 am »
Okay, here's a picture.
I just noticed that the red jumper is in the centre position. Is that significant? My boards run on 5V from an onboard reg and external 12V supply.

 

Offline pgo

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: USBDM programming issue with S08 micros
« Reply #5 on: December 13, 2023, 12:04:42 pm »
Hi,

It's a modified  USBDM_JS16CWJ(it's labelled on the board!).  It has some extra protection(?) diodes I think.

It has target power but it's not automatically controlled - that is what the jumper block does.
When you are prompted to cycle the power you can use the jumper.
Perhaps you could add a normally-closed switch instead of the jumper to be more convenient or at least a jumper with a tag.

If your target board has its own power then you should remove the jumper (although the extra diodes may protect against reverse powering the USB port).

bye
« Last Edit: December 13, 2023, 12:10:02 pm by pgo »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf