A little chaos between the compilers

Hy all

I have some serious problems width the usable compilers .

1. I have a development phase code for q2687 . Some part of these code is working fine on R72 already . But i try on R73 because i have an another problem with R72 , but not 
    working . Exactly the parallel bus is not working , not any error code or simillar , look like everithing working fine but no any output on parallel bus . The code not changed .

2. The oroginal problem with the R72 is a programing problem . I use Pointer type structures with pointer type elements and with the GCC compiler i look a mistic problem .
    These struct pointers sometimes loose the correct value or damaged the contents returned . I dont know why ? I want to try on R73 but i get the point 1 problem . The 
    problematic code section not countinous any special ADL command only C code . I try on visual C and work fine . I use these code on another MCU and already works fine .
    I try the packed structure mode in GCC but not too good resolve for the problem .

PUBLIC struct SD_FileType
{
u8 *Name;
u8 *Ext;
u32 dSize;
u32 dDataAddress;
u32 dPtr;
u8 bMode;
u8 bAttr;
u16 wDate;
} sSD_FileHolterMem , sSD_FileDeviceDat , sSD_FileStatusDat , sSD_FilePatientDat , sSD_FileFirmwareBin , sSD_FileRecLngthDat , sSD_FileAutorunInf ,sSD_FileHolterIco ;

:question:

3. I want to try ADS compiler (ADS DEVS 1.2 ) what i cheking the code on a another compiler but i get new another problems . The ADS compiler compile the code witout any
    error code but the downloaded file alway restart the module . I debug when brokedown the program : 
    local_ret = adl_busIOCtl ( local_handle , ADL_BUS_CMD_SET_PARALLEL_CFG , &local_setting ); These line is the problematic . 
    But the problem in point 2 is not present in ADS .

    I comment out these line but the parallel bus not working on R72 and R73 with ADS . 

 With GCC on R72 the bus and other work fine but have a pointer problem . On R73 GCC and ADS the PBUS not working . On R72 and R73 width ADS Pbus not working .
 ehh and finally with M2M (GCC new version) width R72 the SPI bus not working , and width R73 the Pbus also not working .

 Please help what is the best compiler for open AT ?  :smiley:

I resolve one problem R72a and SPI bus runing correctly under M2M . I modified the spi handling method , inserting a little delay between the reading and woking correctly .
Maybe the new gcc compiler is more faster code ? hmm .

interesting, because i never had any problems with SPI when compiling in M2M (R7.x), i only use the gcc compiler though.

Ahh i found one of the mistic problems source :

In my program i defined a array :

u8 sd_buffer [32];

But i take a mistake these array must be 512 bytes long but i dont look the mistake .

Under old GCC compiler egg 4.0.2.1 , the compiler is not report or override the over reading or writeing in these type of array .
In my code fill these array a spi read function . The spi read is not check the array lenght fill over the memory space . And when
i read and transfer the content from these array also not check the size , simple over reading the memory .

The error is not presented directly only one time is failed the program one time is not .

BUT !! The new compiler in M2M not do this ! The M2M compiler is prohibited that , if i read over the array alway cyclik the content in a ű
loop from the fisrt .

But not send any error or waning message .

These is the main problem my SPI in M2M . Finaly resolved . :laughing:

aaaahh, the power of C

Hmm why not declare the wavecom one of from the compiler is to etalon ? Ahh i may be look my main problem source , with the pointers
may be the array over writing is the key .

I look over the gcc memory map files and the array definied first , may be the array over write is overwrite the pointers arrea  :unamused: .

i test is tomorow ...

Yehh the power of C and the many many version :slight_smile: