Re: [Sdcc-user] pointer reference stays empty

2009-07-21 Thread Bart
Maarten, It's an ADuC832 8051 compatible from Analog Devices. I did some research about _sdcc_startup_external and read the datasheet of the controller again and inserted the following into my code: unsigned char _sdcc_external_startup(void) { CFG832 |= 0x01; return 0; } Since i enable

Re: [Sdcc-user] pointer reference stays empty

2009-07-21 Thread Maarten Brock
Bart, Did you ever mention which mcu you're using? You say it has 2kB of internal ram. But have you checked if you need to enable it? SDCC will not do that for you! The best place to do it is in _sdcc_external_startup(). Maarten > Hello Bodo & Maarten > > My apologies for the very late reply, i

Re: [Sdcc-user] pointer reference stays empty

2009-07-21 Thread Bart
Hello Bodo & Maarten My apologies for the very late reply, i was very busy at work with getting these things done but without the malloc cause i had some deadline pressure. For the moment of this mail i'm not able to look at the outputs with a scope or something so i will do that as soon as i get

Re: [Sdcc-user] pointer reference stays empty

2009-07-06 Thread Maarten Brock
Hello Bart, I agree with Bodo. Xdata is probably not set up correctly. Does your mcu have internal xdata? And do you need to enable it? Otherwise I expect your real external ram not to be working. You should not need to initialize malloc, it's probably ok. Greets, Maarten > Hi Bart, > > Your an

Re: [Sdcc-user] pointer reference stays empty

2009-07-04 Thread Bodo Wenzel
Hi Bart, Your analysis is well done, and I appreciate your assembler knowledge. However, I'm not sure that I do understand what you mean by "Gives nothing on the output port P2." For the moment I assume that each line of P2 doesn't change its level, i.e. it stays at "1" which is the default aft

Re: [Sdcc-user] pointer reference stays empty

2009-07-03 Thread Bart
Yes the malloc is ok. NULL is defined as (void *) 0 and that's not the content of stream, i did your test and he didn't put 0xaa on the output. For example: if(stream == NULL) { P2 = 0xaa; } else { P2 = 0xf0; } gives 0xf0 on the output Even the simplest main with malloc fails: void m

Re: [Sdcc-user] pointer reference stays empty

2009-07-02 Thread Bodo Wenzel
> if(stream == NULL) > return NULL; Are you sure that malloc() returned a valid pointer? For debugging I would change this code into: if (stream == NULL) { P2 = 0xAA; return NULL; } Or, as I know assembler, I would look into the machine code to check it does The Right Thing(TM). HTH,

[Sdcc-user] pointer reference stays empty

2009-07-02 Thread Bart
Hi all, -- System specs: Ubuntu Jaunty Jackelope 9.04 (Linux 2.6.28-13-generic), SDCC 2.9.0 #5416 Target processor: ADuC832 8051 compatible -- Problem: I have a pointer to an unsigned char, i put a char into the variable the pointer is pointing to, push it to some outputs and nothing happens