Reply by rtstofer August 9, 20092009-08-09
--- In l..., "hsutherland2@..." wrote:

> Heh. Now I feel like the doofus I am. I was going to answer "Of course it doesn't work!" Then I thought I should make one last check.
>
> Sure enough, when I upload with the Philips utility, everything works fine.

> -Oh, I meant to mention: Check my math, but I think you can get 0.1% better baud rate accuracy by using 9 and 2 instead of 14 and 3 for your fractional divider :)
>

I'm glad you got it working! I haven't spent much time with JTAG and OpenOCD because it was more effort to get it working under Linux than it was worth. Once I get the serial port working, I can just use console debug messages.

It could be that 9/2 works better. I created a spreadsheet to evaluate all possibilities but I didn't save it.

Richard

An Engineer's Guide to the LPC2100 Series

Reply by "hsu...@sbcglobal.net" August 9, 20092009-08-09
> Whew! I didn't check closely yet, but I'm guessing there is some subtle format difference between the two .hex file formats, that the Philips utility handles correctly, while openocd does not.
>

It was the checksum word :/

Reply by "hsu...@sbcglobal.net" August 9, 20092009-08-09
--- In l..., "rtstofer" wrote:
>
> --- In l..., "hsutherland2@" wrote:
> >
> > I gave Richard's code a try. I'm (sigh) back on windows these days. I was able to (apparently) build with no errors with the following tweaks to his Makefile:
> > 1) LOCATION --> my yagarto location
> > 2) awk --> gawk
> > 3) remove -lgcc from the LIBRARIES line
> >
> > Something still not quite right for me. More research required. After reset, openocd reports "halted in thumb state due to debug request - current mode: Supervisor", and attempts to read flash or VPB registers give me garbage. I've been "stuck" in abort mode before. This is the first time I've been stuck in Supervisor mode. I should probably make a different thread to ask for help on isolating startup problems.
> > But does the program work? I don't use openOCD, I just program the device with lpc21isp. I would hate to think that all of your problems are caused by something with JTAG.
>
> Richard
>
Heh. Now I feel like the doofus I am. I was going to answer "Of course it doesn't work!" Then I thought I should make one last check.

Sure enough, when I upload with the Philips utility, everything works fine. If I use openOCD _after_ uploading that way, I can check RAM, flash, register values, etc, and all is fine. (OpenOCD reports the 2148 to be halted in User mode.)

I can then load one of "my" programs from inside openocd, and all is well. If I then reload the .hex file I made from your code, things are messed up again. But loading with LPC210x_ISP.exe always works.

Whew! I didn't check closely yet, but I'm guessing there is some subtle format difference between the two .hex file formats, that the Philips utility handles correctly, while openocd does not.

Thanks,
-Hugh

-Oh, I meant to mention: Check my math, but I think you can get 0.1% better baud rate accuracy by using 9 and 2 instead of 14 and 3 for your fractional divider :)

Reply by rtstofer August 9, 20092009-08-09
--- In l..., "hsutherland2@..." wrote:
>
> I gave Richard's code a try. I'm (sigh) back on windows these days. I was able to (apparently) build with no errors with the following tweaks to his Makefile:
> 1) LOCATION --> my yagarto location
> 2) awk --> gawk
> 3) remove -lgcc from the LIBRARIES line
>
> Something still not quite right for me. More research required. After reset, openocd reports "halted in thumb state due to debug request - current mode: Supervisor", and attempts to read flash or VPB registers give me garbage. I've been "stuck" in abort mode before. This is the first time I've been stuck in Supervisor mode. I should probably make a different thread to ask for help on isolating startup problems.
>

But does the program work? I don't use openOCD, I just program the device with lpc21isp. I would hate to think that all of your problems are caused by something with JTAG.

Richard
Reply by "hsu...@sbcglobal.net" August 9, 20092009-08-09
I gave Richard's code a try. I'm (sigh) back on windows these days. I was able to (apparently) build with no errors with the following tweaks to his Makefile:
1) LOCATION --> my yagarto location
2) awk --> gawk
3) remove -lgcc from the LIBRARIES line

Something still not quite right for me. More research required. After reset, openocd reports "halted in thumb state due to debug request - current mode: Supervisor", and attempts to read flash or VPB registers give me garbage. I've been "stuck" in abort mode before. This is the first time I've been stuck in Supervisor mode. I should probably make a different thread to ask for help on isolating startup problems.

--- In l..., "rtstofer" wrote:
>
> --- In l..., Raju N wrote:
> >
> > use tx_string to display something in the while (in main ) and try.it is not
> > going to main after excuting uart_isr.
> > Sounds like a postamble missing from the ISR which is usually caused by a messed up prototype.
>
> I gave you LPC2148_UART0_Test.zip in the Files folder which does work and echoes characters using interrupts.
>
> Start with that and work up.
>
> Richard
>
Reply by "hsu...@sbcglobal.net" August 8, 20092009-08-08
Sorry to hear it still isn't working on that end Raju. I had used openocd to check the value of that nloops variable so I knew it was executing the code in main here. I guess we'd have to synchronize compiler settings or some such...

I put a slightly modified project (that prints from main) at
http://www.overtracks.com/sos/20090808/uartb.zip

It worked on the first try here...

Hopefully if you browse through that, and through Richard's code, you can get over this hurdle :)

--- In l..., Raju N wrote:
>
> use tx_string to display something in the while (in main ) and try.it is not
> going to main after excuting uart_isr.
>
> On Sat, Aug 8, 2009 at 6:35 PM, Raju N wrote:
>
> > It is going to isr,it is executing fine.But it is not going to main
> > function after excuting isr .How do to that to go to main function?
> --
> Raju Nalla
> Application Engineer
> Unistring Tech solution pvt Ltd
Reply by rtstofer August 8, 20092009-08-08
--- In l..., Raju N wrote:
>
> use tx_string to display something in the while (in main ) and try.it is not
> going to main after excuting uart_isr.
>

Sounds like a postamble missing from the ISR which is usually caused by a messed up prototype.

I gave you LPC2148_UART0_Test.zip in the Files folder which does work and echoes characters using interrupts.

Start with that and work up.

Richard
Reply by Raju N August 8, 20092009-08-08
use tx_string to display something in the while (in main ) and try.it is not
going to main after excuting uart_isr.

On Sat, Aug 8, 2009 at 6:35 PM, Raju N wrote:

> It is going to isr,it is executing fine.But it is not going to main
> function after excuting isr .How do to that to go to main function?
> On Fri, Aug 7, 2009 at 8:56 PM, Raju N wrote:
>
>> hi h...@sbcglobal.net
>> it is working fine.thank u for u r reply and information.thank u
>>
>> On Thu, Aug 6, 2009 at 5:47 AM, h...@sbcglobal.net <
>> h...@sbcglobal.net> wrote:
>>
>>>
>>>
>>> Did you get your code to work Raju? I don't think there is anything
>>> fundamental wrong with your method. Maybe a typo somewhere that no one could
>>> spot. Or possibly something in the crt.s file.
>>>
>>> I copied your code to my system. But by the time I had modified names to
>>> work with my header files and so forth, I must have made a few typos of my
>>> own... Anyway, after I finally got it to print, I simply re-enabled the Rx
>>> interrupt and that part worked just fine without modification. By that time
>>> I was too tired to go back and figure out exactly where the original problem
>>> was.
>>>
>>> The modified version of your project (that runs on my LPC2148) is at
>>> http://www.overtracks.com/sos/20090804/uart.zip
>>>
>>> I've no idea how difficult it would be for you to build it. Good luck!
>>>
>>> -Hugh
>>>
>>> --- In l... , "raju_nem"
>>> wrote:
>>> >
>>> >
>>> > Hi Michael Anton,
>>> >
>>> > I tried even with U0IER=0x01(only enable with RBR interrupts.
>>> > No change.
>>> >
>>> > I am calling another function in isr,that is Tx_char() or Tx_string()
>>> are (polling method not interrupt).
>>> >
>>> > As u told,i made the CORRESPONDING irq BIT IN CPSR is zero(i.e enable
>>> the IRQ interrupts). No change.
>>> >
>>> > what are the improvements shall i do ?
>>> >
>>>
>>>
>>> --
>> Raju Nalla
>> Application Engineer
>> Unistring Tech solution pvt Ltd
>> --
> Raju Nalla
> Application Engineer
> Unistring Tech solution pvt Ltd
>

--
Raju Nalla
Application Engineer
Unistring Tech solution pvt Ltd


Reply by Raju N August 8, 20092009-08-08
It is going to isr,it is executing fine.But it is not going to main function
after excuting isr .How do to that to go to main function?

On Fri, Aug 7, 2009 at 8:56 PM, Raju N wrote:

> hi h...@sbcglobal.net
> it is working fine.thank u for u r reply and information.thank u
>
> On Thu, Aug 6, 2009 at 5:47 AM, h...@sbcglobal.net <
> h...@sbcglobal.net> wrote:
>
>> Did you get your code to work Raju? I don't think there is anything
>> fundamental wrong with your method. Maybe a typo somewhere that no one could
>> spot. Or possibly something in the crt.s file.
>>
>> I copied your code to my system. But by the time I had modified names to
>> work with my header files and so forth, I must have made a few typos of my
>> own... Anyway, after I finally got it to print, I simply re-enabled the Rx
>> interrupt and that part worked just fine without modification. By that time
>> I was too tired to go back and figure out exactly where the original problem
>> was.
>>
>> The modified version of your project (that runs on my LPC2148) is at
>> http://www.overtracks.com/sos/20090804/uart.zip
>>
>> I've no idea how difficult it would be for you to build it. Good luck!
>>
>> -Hugh
>>
>> --- In l... , "raju_nem"
>> wrote:
>> >
>> >
>> > Hi Michael Anton,
>> >
>> > I tried even with U0IER=0x01(only enable with RBR interrupts.
>> > No change.
>> >
>> > I am calling another function in isr,that is Tx_char() or Tx_string()
>> are (polling method not interrupt).
>> >
>> > As u told,i made the CORRESPONDING irq BIT IN CPSR is zero(i.e enable
>> the IRQ interrupts). No change.
>> >
>> > what are the improvements shall i do ?
>> >
>>
>>
>> --
> Raju Nalla
> Application Engineer
> Unistring Tech solution pvt Ltd
>

--
Raju Nalla
Application Engineer
Unistring Tech solution pvt Ltd


Reply by Raju N August 7, 20092009-08-07
hi h...@sbcglobal.net
it is working fine.thank u for u r reply and information.thank u
On Thu, Aug 6, 2009 at 5:47 AM, h...@sbcglobal.net <
h...@sbcglobal.net> wrote:

> Did you get your code to work Raju? I don't think there is anything
> fundamental wrong with your method. Maybe a typo somewhere that no one could
> spot. Or possibly something in the crt.s file.
>
> I copied your code to my system. But by the time I had modified names to
> work with my header files and so forth, I must have made a few typos of my
> own... Anyway, after I finally got it to print, I simply re-enabled the Rx
> interrupt and that part worked just fine without modification. By that time
> I was too tired to go back and figure out exactly where the original problem
> was.
>
> The modified version of your project (that runs on my LPC2148) is at
> http://www.overtracks.com/sos/20090804/uart.zip
>
> I've no idea how difficult it would be for you to build it. Good luck!
>
> -Hugh
>
> --- In l... , "raju_nem"
> wrote:
> >
> >
> > Hi Michael Anton,
> >
> > I tried even with U0IER=0x01(only enable with RBR interrupts.
> > No change.
> >
> > I am calling another function in isr,that is Tx_char() or Tx_string() are
> (polling method not interrupt).
> >
> > As u told,i made the CORRESPONDING irq BIT IN CPSR is zero(i.e enable the
> IRQ interrupts). No change.
> >
> > what are the improvements shall i do ?
> >
>

--
Raju Nalla
Application Engineer
Unistring Tech solution pvt Ltd