Author Topic: not able to debug  (Read 34728 times)

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
not able to debug
« on: October 28, 2009, 08:06:06 PM »
Hi All,
I am using  LM3S6965 kit with IAR , i am able to download program but not able to debug .
In disassembly window it showing  it stuck in __iar_program_start
I don’t  know what setting required before putting in debug mode   

Thanks And Regards
suhas

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: not able to debug
« Reply #1 on: October 28, 2009, 11:22:26 PM »
Hi Suhas

Generally IAR allows quite reliable debugging. You will need to decide whether debugging from SRAM or from FLASH, whereby the uTasker setup is mainly for working from FLASH.
When working from FLASH make your that you have also loaded the program to FLASH because the debugger may not do this automatically (depends on settings).
When connected to the board by debugger first check the internal registers to see that it is a the reset location, plus check the memory in a memory window. You may identify something which is not as expected which will explain the difficulties.

Regards

Mark

Offline andreseg

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: not able to debug
« Reply #2 on: November 11, 2009, 05:59:30 PM »
Hi suhas.

Try this to start degguging in IAR

Open "Project Options"  and go to "C/C++ Compiler > Output" and select "Generate debug information". Do the same in "Assembler > Output". In "Linker > Output" select "Include debug information in output".
Finally in "Debugger" select Run to main.

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: not able to debug
« Reply #3 on: November 11, 2009, 07:16:47 PM »
Hi mark and andreseg

actually PC not coming out from function fnInitialiseHeap(), i am not able to find out why its hang in this function
it stuck in following while loop
while (ucPattern <= &ucTopOfStack) {                                 
      *ucPattern++ = UNUSED_STACK_PATTERN;
   

Thanks & Regards ,
suhas

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: not able to debug
« Reply #4 on: November 11, 2009, 09:41:48 PM »
Hi suhas

What are the values that you see for these variables?
Also, when you step in assembler mode, can you verify the values seen in the processor's registers?

Finally, beware that if there are a maximum number of break points set in FLASH the debugger may have problems stepping in such routines. I have found that when I try to step over a function with a loop in it the debugger may taken many seconds to return - in which case pausing will result in the code still being in such a loop. I believe what is happening is that the debugger needs to set temporary break points in FLASH and to do this needs to 'borrow' other break points. This means that it has to effectively step through code - changing break points each time rather than actually allowing it to run though it. This can give the impression that the debugger hangs in a routine. The best way to avoid this is to ensure that a minimum of break points are set in FLASH so that the debugger has enough for its own use (it probably has to set more than one to step in some cases, not knowing in exactly which way program flow will go).

Regards

Mark

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: not able to debug
« Reply #5 on: November 22, 2009, 02:27:58 PM »
Thanks mark
                Actually problem with file witch i downloaded now i downloaded new V1.4 now its working fine , thanks a lot

               Can you tell me about html pages means how we can tell compiler to pickup my html pages from my pc and where it store all pages in flash

suhas
 

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: not able to debug
« Reply #6 on: November 22, 2009, 02:43:43 PM »
Hi Suhas

There are various method possible concerning HTTP and files. Generally they are created on the PC (respecting uTasker naming conventions if the uFileSystem is used) and copied to the target via FTP (very similar to any web server).
Alternatively they can be stored in code (user files - compiled into the program) or they can be embedded in a single user file (usually copied with FTP). Mixtures of these are also possible, in either internal FLASH memory or external SPI FLASH memory.

This is described in detail in the following documents:
- http://www.utasker.com/docs/uTasker/uTaskerFileSystem_3.PDF
- http://www.utasker.com/docs/uTasker/uTaskerFileSystemSPI_FLASH_003.PDF
- http://www.utasker.com/docs/uTasker/uTaskerUserFiles.PDF

Also compare the reference web pages in the project at \Applications\uTaskerV1.4\WebPages. The folder includes also a document about how there are assigned within the available FLASH space.

Regards

Mark

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: not able to debug
« Reply #7 on: November 22, 2009, 03:58:35 PM »
Thanks Mark
                 is there any way my html files get compile while i compile my program get load with my program only so i can keep account of my program memory , and i don't need to load it separately.

Regards
suhas   

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: not able to debug
« Reply #8 on: November 22, 2009, 05:59:19 PM »
Hi Suhas

Yes, this is detailed in http://www.utasker.com/docs/uTasker/uTaskerUserFiles.PDF chapter 7.1

Regards

Mark

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: not able to debug
« Reply #9 on: December 10, 2009, 02:38:50 PM »
Hi mark
Can u tell me flow of  html dynamic variable , means when  I press submit button on web page in which function  it go first and after that all the function through it travel

Because I am trying to add my web page but I am not able to do that. 

Thanks And Regards
suhas

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: not able to debug
« Reply #10 on: December 10, 2009, 04:02:18 PM »
Hi

The function fnHandleWeb() is the place to start. It is used to handle all received parameters and also plain text posts.

See also http://www.utasker.com/forum/index.php?topic=100.0

Regards

Mark

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: not able to debug
« Reply #11 on: December 23, 2009, 07:32:04 PM »
Hi Mark
          can u tell me how to use interrupt mean i want  to build one task depends on pin event using that pin interrupt .

Regards
suhas   
« Last Edit: December 23, 2009, 07:40:51 PM by suhas »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: not able to debug
« Reply #12 on: December 23, 2009, 08:27:38 PM »
Hi suhas

1) In app_hw_lm3sxxxx.h you can activate port interrupts with SUPPORT_PORT_INTERRUPTS
2) In the file Port_Interrupts.h you can activate a demonstration of this with IRQ_TEST
3) This will configure several port bits as interrupt inputs (eg. port C, bit 7 as rising edge sensitive) - the ports and bit can be changes as required.
4) When the interrupt occurs (this can also be tested in the simulator by changing the port state by clicking on the port input) the user handler test_irq_4() [which is assigned to this particular interrupt input] will then send an interrupt message to its owner task (application task in this case), which will handle the event.

This should be essentially that which you require.

Regards

Mark

Offline suhas

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: not able to debug
« Reply #13 on: December 28, 2009, 07:50:54 PM »
Hi Mark
Actually i want write task which can wake up on one of port pin interrupt, how can i do that. i do not understand how can i assign interrupt event to particular task .


Regards
Suhas

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3240
    • View Profile
    • uTasker
Re: not able to debug
« Reply #14 on: December 28, 2009, 09:31:01 PM »
Hi Suhas

I still think that the example in the project is what you need. Here is a little more detail.

1) I am assuming that you want your task to run when a port changes state (eg. falling edge on Port C - bit 7). Therefore this interrupt is first configured using the fnConfigureInterrupt() routine as shown in the example code.

2) Assuming that the handler for this interrupt is called int_portC_bit7() and the task that you want to run is MY_TASK, the handler can do this:

static void int_portC_bit7(void)
{
    fnInterruptMessage(MY_TASK, PORT_INT_EVENT);
}


3) PORT_INT_EVENT needs to be defined local (if the task is in the same file) or globally otherwise (eg. in application.h).
Your task will be scheduled by this event message and can then react specifically to the interrupt event PORT_INT_EVENT.
Below is an example of the task code doing this. The task also needs an input queue to receive the message in this case.

extern void fnMyTask(TTASKTABLE *ptrTaskTable)
{
    QUEUE_HANDLE        PortIDInternal = ptrTaskTable->TaskID;           // queue ID for task input
    unsigned char       ucInputMessage[HEADER_LENGTH];                   // reserve space for receiving events (without data)

    while (fnRead( PortIDInternal, ucInputMessage, HEADER_LENGTH)) {    // check input queue
        switch ( ucInputMessage[MSG_SOURCE_TASK] ) {                    // switch depending on message source
        case INTERRUPT_EVENT:
            if ((PORT_INT_EVENT == ucInputMessage[MSG_INTERRUPT_EVENT]) {
                fnDebugMsg("Interrupt detected\r\n");
            }
            break;
        }
    }
}


Using this technique it is also possible for the task to recognise various such interrupt events - simply add more event types to the case and assign more interrupts to send them.

Regards

Mark