"No BDM Tx routine was found" with USBDM_ReadMemory();

cancel
Showing results for 
Search instead for 
Did you mean: 

"No BDM Tx routine was found" with USBDM_ReadMemory();

Jump to solution
2,152 Views
Contributor III

I am trying to read the registers on a locked/secured 9s12 and i get this "No BDM Tx routine was found" as an error.

I am using USBDM_ReadMemory(). The error is there but some data are returned. So for example if i try to read the Part ID, address 0x001A, i get 0x0022 as a result.

I am expecting to get something like 0x4220. Do i need to pull moda and modb to gnd?

1 Solution
44 Views
Contributor III

Pgo, thank you for the reply,

the spi mode that i am refering exists on the mcu that i am working on. I dont know about other 9s12 variants. On the datasheet it mentions that during reset you can choose between 2 BDM modes. One is the regular bdm "single wire" mode that you know and the other is called SPI BDM mode.

Here is a part from the datasheet

"While the part is in reset, this pin selects whether the FBDM will operate

as a single-wire interface (SPIMODE = 0) or multi-wire SPI type interface

(SPIMODE = 1). When reset is released this mode is locked in and

cannot be changed until the next reset."


I know that i have limited access and this is what i want to research now. What commands i can use and stuff like that.

Thank you for the example.

View solution in original post

0 Kudos
5 Replies
44 Views
Senior Contributor V

Hi Padelis,

There are a range of communication routines to cover different speeds.

That error indicates that it couldn't find a suitable routine or determine the speed of communication.

You haven't given the chip type.  Some chips don't support the sync command and the alternative software method used doesn't work reliably with a secured chip.  The only other method is "guessing" based up accessing one of few locations readable when secured.

Any data returned with the error is meaningless.

A few questions:

  • What chip is it?
  • Does the stand-alone programmer detect the chip correctly?
  • Does it produce an alert?
  • Have you enabled "guess speed" option using
    USBDM_SetOptions()

bye

0 Kudos
44 Views
Contributor III

Hi pgo,

i missed to mention some data.

Chip type is 9S12 T64.

The HCS12 programmer doesnt detect it either. I have tried all different settings and combinations but all i get is "General Fail (for compatibility)".

In my software i tried the "guessSpeed = true" but i had no luck. I still get the "No BDM Tx routine was found" when i try to connect.

I have checked the connections many time. I have also tried to power it using external supply but still no luck.

I tried to pull MODA and MODB to gnd but still no luck. It feels like there is an issue with the BDM hardware that i am using.

I have tested the lines with a logic analyser and they work.

Any thoughts on this?

0 Kudos
44 Views
Contributor III

I fixed the "No BDM Tx routine was found" error! The problem was that the selected bdm mode was spi.

Now that i corrected the error above, i get this one "Target BDM Enable failed". Despite the fact that i get this error i can read the ECU ID which is 0x4220.

Actually when i read it, it is reversed, 0x2042.

The target is secured and i am wondering what commands i can use to read the bdm registers and all that!

At least now i can connect and it actually syncs at Crystal/2 Hz.

0 Kudos
44 Views
Senior Contributor V

Hi Padelis,

I don't know what 'spi' mode is.  If you select a HCS12 target then there is only a single mode of communication.  Or do you mean something on the target?  I'm not familiar with the chip you mention.

That message "Target BDM Enable failed" is the error you get when trying to activate the Background Debug Mode on a secured device.

You can ignore it but you still only have very limited access to the target.

The attached program (based on the example in the USBDM Manual) demonstrates reading memory of a HCS12 using the USBDM API.

The value read for the partid (@0x1A-0x1B) was not reversed for the chip I tried so I'm unsure what you mean.  Are you casting to an int or something?  PCs are little-endian while the HCS12 is big-endian.

Reading other regions of memory on a secured chip return random data - not an error.

bye

45 Views
Contributor III

Pgo, thank you for the reply,

the spi mode that i am refering exists on the mcu that i am working on. I dont know about other 9s12 variants. On the datasheet it mentions that during reset you can choose between 2 BDM modes. One is the regular bdm "single wire" mode that you know and the other is called SPI BDM mode.

Here is a part from the datasheet

"While the part is in reset, this pin selects whether the FBDM will operate

as a single-wire interface (SPIMODE = 0) or multi-wire SPI type interface

(SPIMODE = 1). When reset is released this mode is locked in and

cannot be changed until the next reset."


I know that i have limited access and this is what i want to research now. What commands i can use and stuff like that.

Thank you for the example.

View solution in original post

0 Kudos