Search Forums by tag:
Serial, mbed, compiler, ethernet, USB, I2C, SPI, interrupt, LCD, library, bug, HTTPServer, CAN, AnalogIn, adc, Power, Ticker, memory, pwm, SD Card, InterruptIn, rpc, Error, SDFileSystem, PwmOut, LocalFileSystem, UART, canbus, driver, TCP, interrupts, rtos, led, libraries, editor, timer, accelerometer, GPS, file, clock, website, C++, SD, frequency, reset, http, LPC11U24, flash, SDCard, RTC, DigitalIn, TCPSocket, problem, printf, Java, Servo, buffer, UDP, SerialPC, DMA, HTTPClient, Sleep, audio, pinball, MODSERIAL, NetServices, socket, array, compile, filesystem, RFID, beta, m3pi, write, LPC1768, multiple, newbie, keyboard, sensor, GPRS, Forum, digitalOut, assembly, debug, hardware, Speed, xbee, AnalogOut, RPCFunction, EthernetNetIf, Download, code, voltage, wait, network, C, suggestion, JTAG, keil, MATLAB, offline, Board, lwip, I2S, dead, Nokia6610, time, bluetooth, WiFly, current, tcp/ip, MODDMA, SPI Slave, pololu, robot, Communication, read, dac, string, pc, binary, filter, copy, USB Host, publish, rs232, DHCP, Host, Data Logging, windows, firmware, malloc, mp3, PCB, gcc, attach, program, fatfilesystem, class, email, arduino, stepper motor, WavePlayer, wifi, Nokia, camera, size, VGA, import, documentation, ide, linux, baud, TextLCD, Cortex-M0, M0, pointers, pullup, Relay, timing, function, latency, serial port, MIDI, compiler error codes, magjack, touch, screen, Production, client, server, stream, HID, breakout, FIFO, prototype, flashing, GPIO, sampling, Analog, display, api, ADXL345, Encoder, DSP, help, motor, sram, suggestions, PING, Terminal, link, browser, Pin, control, Eagle, Modbus, EEPROM, mac, Timeout, fopen, port, updates, usbserial, batteries, DMX, files, USBMIDI, scanf, protocol, PPP, slave, FTP, integer, noise, MODGPS, modem, float, threads, motors, for, monitor, Digital I/O, 7, Windows Serial Driver, pins, keypad, FAT, classes, webserver, delay, variables, time-triggered, c programming, labview, watchdog, post, math, Battery, LPCXpresso, MBED website, GSM, storage, nxp, mobileLCD, license, int, counter, baseboard, Assembler, Vin, rj45, registers, E289, news, i2cmaster, amoled, Compiling, connect, revision, prototype to hardware, UMTSStick, Optocoupler, Robotics, search, oscillator, glitch, Websockets, load, find, real-time, routine, format, offline compile, powersource, driverlibrary, processing, networking, ID, umts, debugging, color, BUTTON, software, PS3, Images, wave, bin, const, SNMP, OSX, supply, peripheral, sensors, data, Design, PID, version, RIT, character, freeze, USBDevice, bus, ARM, wav, SRF08, heap, output, basic, TFT, QVGA, mysql, piezo, update, ID12, Pachube, player, DigitalInOut, object, cmsis, capture, IR, slow, 1768, PSP, OS, syntax, mbed.lib, EmbeddedArtists, NMEA, paste, project, Web, GUI, UART0, firefox, SQL, wakeup, RAM, bitmap, handler, security, 3D, bugs, OLED, Temperature, not, I/O, Bidirectional, rss, wireless, delete, resolved, LED1, LIS302, getc, Safari, Wi-Fi, wiki, PinNames, accounts, PS2, BusOut, projects, RS485, pythonWell, you could possibly create an interrupt function, that will write the address, when a button is pressed.
I'll look into the datasheet soon, an see if possible, to get address of the program.
/ Lerche
That would be great. I had another project 6 months ago that I had to give up on because of the same reason.
I did something similar on our ARM7 Oberon-07 system but using a timer interrupt. The interrupt handler just prints out the value of the link register (i.e. the address that the interrupt handler came from / will return to) every second or so. When the address changes become repetitive there is a good chance it is in a loop. It only took a couple of minutes to track down the culprit.
You are certainly welcome to it but I don't think it will help you much more than I have said already. It is the technique not the actual code that is relevant - this was written in Oberon-07 for the LPC2xxx series:
PROCEDURE TimerHandler[4]; (* 4 for IRQ or FIQ *)
VAR
lnk: INTEGER;
BEGIN
INC(timeVal);
(* Retrieve the saved value of the link register *)
SYSTEM.GET(SYSTEM.FP + (13 * 4), lnk);
Out.Char('t'); Out.Int(timeVal, 6); Out.Hex(lnk, 12); Out.Ln;
(* Clear the MR0 interrupt *)
SYSTEM.PUT(LPC.T1IR, {0});
(* Update the VIC priority hardware *)
SYSTEM.PUT(LPC.VICVectAddr, 0)
END TimerHandler;
The value (13 * 4) is explained by the fact that the following instructions are excuted on entry to the interrupt handler:
stmdb sp!, { r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 fp lr }
mov fp,sp
So all we are doing is accessing the value of the link register (lr = R13) using the value of the stack pointer (sp = R14) that was saved in the frame pointer (fp = R12)
It might be even easier on the LPC17xx. I can't find my mbed (being miniature is not always a good thing!) but I've just had a look at the code generated for the LPCXpresso. It looks as though lr is untouched in the IRQ handler. I just don't know the best way of accessing the value of lr using C.
Regards,
Chris.
Please log in to post a reply.
No tags
|
I have a program that occasionally hangs in some function (loop) and I was hoping someone has a way of telling me where the program is hung. I could ground the NMI or some other pin to tell the program to printf its pc address but that is a little much for me to do. Any suggestions would be welcome.
regards