Author Topic: m68332 BDM and …. gdb ???  (Read 25873 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #50 on: October 01, 2018, 12:14:53 am »
The Lauterbach ICE-68330 seems THE tool to go since it's an ICE able to debug everything, including the TPU module. This is also a proof that all the documentation between the BDM and the TPU is ... missing in my manuals.

Anyway, it's a marvelous tool! Hard to find, and it seems very very expensive, especially with the probe.
An additional problem: the CPU module on my EVS card is soldered

Awesome: I am adding it to my next Santa Claus's letter  :D :D :D
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #51 on: October 01, 2018, 04:39:58 am »
CPU32-BDM https://drive.google.com/open?id=13tUBaU9b58XVYlFD4N-lR56DT6ASL584I didn't look carefully before (well, I still haven't looked "carefully"), but it almost seems like the CPU32 implements a sort of proto-BDM - there's the serial link, but a lot of operations seem to require fiddling with other signals as well.  (perhaps this is just the consequence of having external memory buses?)
(page 4&5 are at the end of the document.  Oops.)
« Last Edit: October 01, 2018, 04:42:14 am by westfw »
 

Offline Gribo

  • Frequent Contributor
  • **
  • Posts: 629
  • Country: ca
Re: m68332 BDM and …. gdb ???
« Reply #52 on: October 01, 2018, 03:02:23 pm »
Legacy: How do you program your boards? I have to support a design with the 68332, and intend to use the PEmicro Multilink programmer.
I am available for freelance work.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #53 on: October 01, 2018, 03:23:10 pm »
Legacy: How do you program your boards? I have to support a design with the 68332, and intend to use the PEmicro Multilink programmer.

Currently, I am operating via an home-made ROM emulator USB-bulk driven. It emulates two ROMs in parallel, and it's fine for the EVS board which have EVEN and ODD ROMs on the 16bit bus of the CPU. But the built-in firmware on the EVS board is a "DBUG32", a monitor that is able to upload stuff in ram. It loads and decodes SREC-S19, but it doesn't understand the S0-header if it contains metadata. It's very raw and wild, but it allows you to see, modify, and fill the ram. This can be re-used to prepare a gdb-bridge. Modern GDB repositories don't support anything about that, and the support they had for some old board, has been recently removed from modern releases. Therefore, it's all up to you.

I haven't yet tried the PEmicro BDM, it's too expensive and it doesn't come with what I want and need, hence I am using the DI-module on the EVS board that comes with a BDM-to-uart debugger, and an LPT cable with a BDM interface. Both of them are driven by a DOS application, the one for the LTP-BDM cable is only able to program the flash, it can't be used to debug. The one on the DI-module does full debugging.


Anyway, the FPGA-BDM adapter I am willing to build will not be a PE replacement for the business/hobby since I am not willing to support anything else except a gdb-bridge for a simplified gdb-server.

p.s.
I am willing to buy a Lauterbach ICE-68330 unit. It's the best ever, and it's the only tool that supports the TPU debugging: this information is completely missing in every public Motorola documentation I have ever read, and probably it's confidential and classified. Hence, if I will get my hands on the ICE I will for sure need to spend a lot of time at reverse engineering it.

The TPU is a wonderful and useful coprocessor. A couple of Beckman's spectrometers are based on 332 and use the TPU for their tasks. My understanding of details is limited.
« Last Edit: October 03, 2018, 09:03:22 am by legacy »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #54 on: October 01, 2018, 03:28:45 pm »
as toolchain, I am using
- GNU Gcc + binutils
- Sierra C
- Avocet 68K    <----------- this one is the best ever!

they build an SREC file, then I upload it to board via DBUG32 via UART, or I load it into my ROM emulator interface.

DBUG32 can be modified to program a flash. There was around a patch.
 

Offline Harjit

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #55 on: October 02, 2018, 05:44:14 am »
I would love to find an inexpensive USB based BDM solution that allows me to program flash devices connected to the 68332.

I can't get to the flash devices because they are only connected to the 68332.

Any luck finding something?

Very glad you are doing this.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #56 on: October 02, 2018, 05:59:33 am »
PEmicro Multilink programmer.

which toolchain are you willing to use?
 

Offline Harjit

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #57 on: October 02, 2018, 06:18:33 am »
Willing - GCC / GDB <- I will have to learn it.

If there is something else, if it is super inexpensive, I'm game.

I have a license for SDS which WindRiver and then Intel acquired but it only supports a parallel port based BDM dongle.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #58 on: October 02, 2018, 06:35:39 am »
Willing - GCC / GDB <- I will have to learn it.

If there is something else, if it is super inexpensive, I'm game.

You have to define inexpensive  :D

If you mean the money for a purchase: it's open source, but ... it doesn't work out of the box
Hence if you mean time (time is money), well ... you can start with a simple gdb-stub, that is pure software, and uses the supervisor mode + interrupts. This is the most inexpensive time way, and you debug via uart.

The next step is realizing a gdb-bridge for the BDM, and then a gdb-server. This takes A LOT of time.

Quote
parallel port based BDM dongle.

this probably is the cable I was talking about. Years ago, there was a schematic on Motorola's ftp, and a DOS program to use it to program flash chip via BDM.
 

Offline Harjit

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #59 on: October 02, 2018, 07:06:50 am »
Fair points. Would love your guidance and thoughts.

I don't know - under $100? This is for a hobby project.

I have SDS's compiler. I may be able to find sources for dBug or dBug32 and use that as a monitor on the target.

Thank you!
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #60 on: October 02, 2018, 07:31:49 am »
sources for dBug or dBug32

we (at DownTheBunker) are collecting resources for old MPUs.
Maybe Elisabeth (Madame) has the source of dBug32.
Somewhere in her loft, where she has floppies and CDROMs archive.

I will ask the first time I see her around  :D

p.s.
which is the hardware board you are on?
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #61 on: October 02, 2018, 07:36:08 am »
(we can dump ROMs from the EVS, and upload them if they are useful. These couple of ROMs, Even and Odd, contain dBug32)
 

Offline sca

  • Regular Contributor
  • *
  • Posts: 68
Re: m68332 BDM and …. gdb ???
« Reply #62 on: October 02, 2018, 08:33:43 am »
Not sure if this is helpful or not....

I recall reading on the excellent and unfortunately demised Max's Little Robot Shop that he used an Abatron debugger with these devices. They crop up on ebay occasionally for not much, and, IIRC, support USB and Ethernet interface to host.

sca
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #63 on: October 02, 2018, 08:49:47 am »
Not sure if this is helpful or not....

if your memory layout is the same as the EVS board, then it works, hence it may be helpful, I guess.

demised Max's Little Robot Shop

Is there an article about that? If so, can you upload here ?

Abatron debugger with these devices. They crop up on ebay occasionally for not much, and, IIRC, support USB and Ethernet interface to host.

Usually for no less than 200-250 euro, and you specifically need to find a license for a specific target/protocol, e.g. Abatron for "683332/gdb". Besides, the gdb-server support is not so brilliant and doesn't include any TPU-debugging. It's only for the CPU32 core.
« Last Edit: October 02, 2018, 11:10:17 pm by legacy »
 

Offline Harjit

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #64 on: October 02, 2018, 09:49:47 pm »
My board is one I designed back in the mid-90s.

It actually uses a MC68376 or MC68336 with AM29F200 x16 flash and two M5M51008 SRAMs. Since it is custom design, I don't think it will map well to the 68332 design.

 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #65 on: October 02, 2018, 09:56:55 pm »
Quote
I would love to find an inexpensive USB based BDM solution that allows me to program flash devices connected to the 68332.
Surely this consists of "load this short bit of 68332 code that knows how to program the particular flash chips in use, and this buffer containing the data I want to put there, and then let it run until it returns to BDM mode."  The 68332 doesn't have any knowledge at all about the programming algorithms for external flash chips...
This means your hypothetical flash-loader needs to:Put the 332 into debug mode.Write the registers (which are in the RAM address space) to configure RAM.  (It looks like the 332 has 2k of internal TPURAM; I don't know whether that's easier or more difficult to configure than external RAM.)
Load the RAM with your flash-aware code, and a block of data to write to flash.Start execution of the loaded code.Wait for it to finish.(repeat, perhaps only re-writing the data block.)
That doesn't sound awful - in particular, it doesn't seem like it would run into the "complicated" cases where you're trying to force BDM from assorting running states...
 

Offline Harjit

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #66 on: October 02, 2018, 10:04:38 pm »
There are two different ways people have done this:
1) Use the BDM to actually run flash cycles - SDS does this
2) Do what you said, download code to RAM, download programming code to RAM, execute from programming code in RAM to program the flash

I have used both cases. Just an hour ago, I found the code for #2. I had forgotten that I had written it.

Right now, I'm stuck with no ability to configure the chip selects on the microcontroller and then write the stuff to RAM. Sigh!

I have a parallel port BDM dongle but no parallel port. I've seen USB to parallel port adapters but I haven't tried them because I think the software bangs on the I/O port directly and that isn't very kosher with Windows or the USB to parallel port adapters. If someone has made this work, that would be great to learn about.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #67 on: October 02, 2018, 10:34:11 pm »
USB to parallel port adapters

usually, they don't work.

We had (note the past, I don't have on hands, I have to search and find it) a modified version of dBug32 able to upload stuff from the uart, and then to program the flash. This is the way you can go.
« Last Edit: October 02, 2018, 11:14:19 pm by legacy »
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #68 on: October 03, 2018, 02:01:28 am »
Quote
USB to parallel port adapters
Most of those are actually "printer adapters", and don't support raw access to the pins at all.
You'd think that it would be possible, with all the protection and virtualization features of a modern x86, to build a hardware/software combination that more faithfully duplicated the raw hardware interface of the old parallel port, with arbitrary communications paths in between the x86 application and the actual DB25 connector.  Except for timing, perhaps :-(Is there something that comes close?  It would be good to know!
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #69 on: October 03, 2018, 09:38:30 am »
You'd think that it would be possible, with all the protection and virtualization features of a modern x86, to build a hardware/software combination that more faithfully duplicated the raw hardware interface of the old parallel port, with arbitrary communications paths in between the x86 application and the actual DB25 connector

On Linux, perhaps.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #70 on: October 03, 2018, 09:39:37 am »
For m68332, there was another monitor, called "CPU32bug".
This one had a patch allowing onboard flash programming.
 

Offline sca

  • Regular Contributor
  • *
  • Posts: 68
Re: m68332 BDM and …. gdb ???
« Reply #71 on: October 03, 2018, 10:03:08 am »
demised Max's Little Robot Shop

Is there an article about that? If so, can you upload here ?
Not that I'm aware of. I've never found a good archive of the site. Shame because it was an excellent, if jealousy inspiring read!

Abatron debugger with these devices. They crop up on ebay occasionally for not much, and, IIRC, support USB and Ethernet interface to host.

Usually for no less than 200-250 euro, and you specifically need to find a license for a specific target/protocol, e.g. Abatron for "683332/gdb". Besides, the gdb-server support is not so brilliant and doesn't include any TPU-debugging. It's only for the CPU32 core.
I've seen them go unsold for a long time - might fall into the 'try a lowball offer' category.

I've no personal experience with these devices though, so can only go from distant memory. Good luck with your search!

sca
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #72 on: October 05, 2018, 06:17:53 pm »
Code: [Select]
Motorola 332Bug v1.00
332Bug>
332Bug>help
BC       Block Compare
BF       Block Fill
BM       Block Move
BR       Breakpoint Insert
NOBR     Breakpoint Delete
BS       Block Search
BV       Block Verify
DC       Data Conversion and Expression Evaluation
DU       Dump S-Records
GD       Go Direct (no breakpoints)
GN       Go and Stop after Next Instruction
GO       Go to Target Code
G        "Alias" for previous command
GT       Go and Insert Temporary Breakpoint
HE       Help Facility
LO       Load S-Records
MA       Macro Define/Display
NOMA     Macro Delete
MAE      Macro Edit
MAL      Enable Macro Expansion Listing
NOMAL    Disable Macro Expansion Listing
MD       Memory Display
MM       Memory Modify
M        "Alias" for previous command
MS       Memory Set
OF       Offset Registers
PA       Printer Attach
NOPA     Printer Detach
PF       Port Format
RD       Register Display
RESET    Warm/Cold Reset
RM       Register Modify
RS       Register Set
T        Trace Instruction
TC       Trace on Change of Flow
TM       Transparent Mode
TT       Trace to Temporary Breakpoint
VE       Verify S-Records
332Bug>
 

Offline Harjit

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
Re: m68332 BDM and …. gdb ???
« Reply #73 on: October 08, 2018, 04:08:33 pm »
http://www.usbjtag.com/ has a USB BDM device (USB BDM NT) that seems perfect for programming system flash at a reasonable price.

The designer/author is quite responsive i.e. I asked him if he supported the MC68336/MC68376 and he said he didn't but if I sent him the memory map, he would create the XML file for it.

Besides this device, I have not come across anything in this price range.

Given that it is a BDM device, I'm sure a GDB stub could be written / adapted for it.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: m68332 BDM and …. gdb ???
« Reply #74 on: October 08, 2018, 09:43:57 pm »
http://www.usbjtag.com/ has a USB BDM device (USB BDM NT) that seems perfect for programming system flash at a reasonable price.

Thanks. It looks interesting.

GDB stub

GDB-stub is related to the software running on the CPU.
GDB-bridge is a way to translate GDB commands into specific hw-emulator/ICE's commands.

Hence you want a GDB-bridge to make gdb drive the USB-BDM :D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf