same source code ,same compiler tools,ubunto vs. windows xp,different behavior,why? almost same map files

300 views Asked by At

I have a problem.I have an evaluation kit and a starter_kit program which works pretty well with the toolsuites plugin of the IDE under WINDOWS xp.The same toolsuites plugin of the IDE sous Ubuntu 12.0.4 does work but doesn't do the same thing.Weired no ? just for information, my tools are:

  • MCU:PIC24HJ128GP504
  • Board:MPLAB STARTER KIT for PIC24H MCU
  • USB connection for load/debug SKDE PIC24H SENSOR
  • IDE:MPLABX IDE v1.85
  • C compiler:XC16 V1.11
  • source code: starter kit for pic24 H sensor Demo

in UBUNTU, I compile and link that source code in MPLAB X ide using XC16 C compiler without any error and then program the device but then after that Microchip logo (start-up exercise) appears on OLED,the other parts of the code are not executed ( Home screen e.g).and OLED just blinks and repeats showing Microchip logo while blinking.seems to me that it enters to a RESET LOOP.

What is weird is that when i change the OS from ubuntu to windows xp and use the same IDE installed on windows xp and same C compiler and program the device, it works perfect and doesn't enter to this seemingly reset loop.and it shows Microchip logo(start-up exercise) and executes the rest of the program(which is a Home screen). and I don't know what is wrong. I used this step to debug this problem with no succeed, and i would like to know what you would do if you're in my case, and if you can help me find my problem.

  • compare map files (linker outputs): the two files are almost the same except that map of winXP has a resetPRI function, but that of ubuntu uses reset(which seems to me that it's a memory section, not a function).you can see the common part of map file and the differences below.

External Symbols in Program Memory (by address):

              0x000200                  __resetPRI 
Memory Configuration:

Name             Origin             Length             Attributes
data             0x000800           0x002000           a !xr
reset            0x000000           0x000004   
program          0x000200           0x015600    

LOAD libp24HJ128GP504-elf.a


.reset            0x000000          0x4 
                  0x000000          0x2 SHORT 0x200 ABSOLUTE (__reset)
                  0x000001          0x2 SHORT 0x4
                  0x000002          0x2 SHORT 0x0 ((ABSOLUTE (__reset) >> 0x10) & 0x7f)
                  0x000003          0x2 SHORT 0x0

.text             0x000200        0xf06



libpic30-elf.a(crt0_standard.o)
              0x000200                  __reset (difference:from ubuntu map file)
              0x000200                  __resetPRI (difference:from winxp map file)
build/default/production/_ext/1360937237/**Main.o** 

_0x40c515645214dac2 (difference:from ubuntu map file)
_0213CF005214c228   (difference:from winxp map file)
                    0x2600        0x1c0
 _0x40c515645214dac2  (difference:from ubuntu map file)
 _0213CF005214c228   (difference:from winxp map file)
                    0x2600        0x1c0 build/default/production/_ext/1360937237       /Accelerometer.o   (ONE function in the program )  
                0x2600                  _BufferA

  _0x40c515c05214dac2  (difference:from ubuntu map file)
_0213D1205214c228       (difference:from winxp map file)

any idea where should i look for the problem would be greatly appreciated.

0

There are 0 answers