Author Topic: hardware for flash magic  (Read 14051 times)

sukhdeep

  • Jr. Member
  • **
  • Posts: 1
    • View Profile
    • Email
hardware for flash magic
« on: January 15, 2009, 01:35:59 am »
Dear Sir,
            i want to program the LPC2378 using flash magic. what should be the hardware connection with serial port (DB-9). which pin of LPC2378 should be connected with DB-9 connector.

Thanks
sukhdeep

erikm

  • Full Member
  • ***
  • Posts: 113
    • View Profile
Re: hardware for flash magic
« Reply #1 on: January 15, 2009, 05:16:04 am »
which pin of LPC2378 should be connected with DB-9 connector.

none, or you will have to go buy a new chip. You need a MAX232 (equivalent)

Erik
erik

Je Gold

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: hardware for flash magic
« Reply #2 on: January 15, 2009, 05:30:34 am »
Run flashmagic  --> CLick Help --> Click manual   --> read Page 46. and see attached

Look at keil reference design schematic also  here
http://www.keil.com/mcb2300/mcb2300-schematics.pdf

Read  Section in NXP LPC2387  User Manual on BOOTLOADER

Joe

Also be aware that some of the JTAG pin effect operation on POR (Power On Reset).
« Last Edit: March 07, 2009, 04:50:38 am by Je Gold »

analox

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: hardware for flash magic
« Reply #3 on: March 02, 2009, 02:49:25 am »
Hey all,

Got autobaud problem at stage 1. - But right now I am using simplier hardware, just TXD and RXD , P014 driven to low via jumper on PCB and resetting manually.

I am aware of the suggested hardware (as seen on both the Keil PCB as well as the FM manual.

The question is if the two "connections" (talking of driving low here) DTR/Reset and RTS/P014 are <<really>> mandatory - eg if FM uses the RESET more often to stimulate the embedded programming firmware.

tia
willi behrens

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: hardware for flash magic
« Reply #4 on: March 02, 2009, 08:05:55 am »
The use of DTR and RTS are optional. They are only used at the beginning to place the device into programming mode and at the end to execute firmware.

I have boards here that use push buttons to place a device into programming mode and it works fine.

I would check with a scope to see if the '?' is arriving at the RxD pin of the device.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

analox

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: hardware for flash magic
« Reply #5 on: March 02, 2009, 08:40:39 am »
OK, thanx

I was unsure if the stuff around those two signals was really optional - maybe due to some handshaking. So my simple jumper to GND and pushbutten reset solution *should* work. So I can start to look somewhere else.

(and yes, the SIO is set up properly, just doublechecked with terminalprogram and a second 3.3 RXD pin connected to just antoher terminal via level shifter. Both signals pass)

just fed the '?' manually during reset (autorepeatedly) , but no meaningful replies at all , looks to me like crap of this type "<<?"

but both SIO ways are fine (checked again thru shorting right at the socket -> all proper ? as expected)

analox

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: hardware for flash magic
« Reply #6 on: March 02, 2009, 08:41:50 am »
sorry, forgot: I am sending manually ? at 9600bd

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: hardware for flash magic
« Reply #7 on: March 02, 2009, 08:45:14 am »
Assuming you don't have firmware in the device that uses the UART, it seems that the bootloader is running but failed to correctly measure the baudrate of the '?'. 9600 baud should work at 10MHz and above. The slower the crystal frequency the harder 9600 baud will be to use.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

analox

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: hardware for flash magic
« Reply #8 on: March 02, 2009, 09:16:11 am »
OUCH !

did I miss something here? I was not aware that my "real application" must not use the SIO.
So I AM using UART0. May this be causing the problem ? btw quartz is at 12 Mhz

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: hardware for flash magic
« Reply #9 on: March 02, 2009, 09:51:01 am »
If the device is sending a mangled response to the '?' and your firmware does not use the UART then the only code in the device that can do that is the bootloader. Therefore the bootloader is running.

If your firmware does send data out of the UART then we don't know whether it is your firmware or the bootloader that is sending the mangled data.

So yes, it is fine if your firmware uses the UART (the device executes either the bootloader OR your firmware). But knowing if the bootloader is running or not would help you track down the problem.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

analox

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: hardware for flash magic
« Reply #10 on: March 03, 2009, 06:18:02 am »
Andy,

First of all and __VERY__ important to me:
Please let me say I really appreciate your helpful contributions!!

I took a break and made something completely different to get away from the problem and to return with new "blank head" - as this is often helpful ;)

So restarting HERE:

after commenting out any UART0 related code in my application I got a "Synchronized" almost immediately in Terminal after the 9k6 '?' , so I attached FM instead and was able to read Chip ID - so the basic transfer is working. BUT WHY ? you see me in 100% confusion
I thought an ARM reset would cause the CPU to sample the ISP-PIN and if in ISP mode, to never enter my code. How can then my code get executed and disturb the ISP communication ... ?!?!
(connection to read chip ID works up to and inkluding 230 k)

Then I tried to program and found it to be not working, no matter how low I set the baudrate (even at 9600). If I press <START>, it begins erasing sectors and then ends up in a dialog box saying:
[Operation Failed. (Failed to erase block nn)]  with n varying from say 2 to 6)

And, even more interesting is the fact I get no connection at all trying a different PC (Toshiba Tecra XPProSP2)

So put together, my intial single question ends up in three: ;)

1) Why does my UART0 usage disturb the bootloader startup? (Code is imo supposed to be sleeping then)

2) Why does the programming fail?

3) What's wrong with my Toshiba Notebook?
(AS it is in the docking station I assume here that is not a "real" serial chip, but something glued to the bus via USB, so this might be same as with the different USB adapters here in the forum I guess .. but VERY disappointing !)

many thanks in advance

WILLI

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: hardware for flash magic
« Reply #11 on: March 03, 2009, 08:21:28 am »
1. I think that it was a coincidence. Without using a terminal program can Flash Magic read the device signature?

2. Not sure. Please generate and send us a debug file. Instructions are here: http://www.flashmagictool.com/debugfile.html. Please reference this thread in your email.

3. Also don't know. This could be somehow connected to item 2. I.e. solving item 2 might also solve item 3.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: hardware for flash magic
« Reply #12 on: March 03, 2009, 09:13:14 am »
The debug file shows the device sending data back then sending junk as if it changed baud rates. We suspect an electrical issue.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

analox

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: hardware for flash magic
« Reply #13 on: March 05, 2009, 07:56:51 am »
Problem located and fixed.

The ISP routine seems to toggle/glitch a pin that we happen to use for our external watchdog device. (it is P2.13 on 2366) So the dog is bitchy and kills the ARM roundabout every second. This explains quite well why only short commands work ;)

Sorry for overseing such an obvious point. !!! Many apologies !!!

Question:
Anybody knowing which pin to use for a watchdog? or other way round - is there a spec out by NXP <<guaranteeing>> "silent pins" ?

tia
Willi


analox

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: hardware for flash magic
« Reply #14 on: March 10, 2009, 07:30:16 am »
Suggestion for SOLUTION:

constraint: we have GND,VCC,RXD,TXD,ISP_ENABLE and Reset on our programming connector.

As we got no feedback by NXP yet and need to redesign the PCB shortly, we decided to work around the problem the following way:

We leave the internal reset as is, including the watchdog stuff - and accept periodic reset pulses.
We make the reset-ic's output signal a bit softer (1000 Ohm serial) from IC to ARM
As programming adapter, we use the FM suggested hardware with a slight modification.
The reset signal will not be tristate, but ordinary 0/1, so FM is capable of driving the reset hard to 1.
As long as the incoming DTR (-> becoming RESET) is a clear signal, this should work fine, and the watchdog should have to remain in its doghouse ;)