> Hello,
>
> I have a hardware board with 80390 core. I want to use SDCC in ds390
> flat42 (24 bit address) memory mode.
>
> But I don't want to use tinibios and its startup code (tinibios has
> _sdcc_external_startup, clock and serial port initialization).
>
> I modified <SDCC>/device/examples/ds390/hello390.c to include my own
> _sdcc_external_startup (and clock and serial port ISRs for satisfying
> linker dependencies).
>
> The above mentioned hello390.c is compiled/linked using the following
> command
>
------------------------------------------------------------------------
> ----------------------
>
> sdcc --verbose -mds390 --xram-loc 0x00 --code-loc 0x00 \
> -Wl-r hello390.c --nostdlib
> -l../../../lib/build/ds390/liblong.lib
> -l../../../lib/build/ds390/libsdcc.lib
> -l../../../lib/build/ds390/libfloat.lib
>
------------------------------------------------------------------------
> ----------------------
>
> It generates hello390.ihx, which I am able to burn to my hw board's
> flash (after converting to binary using hex2bin tool), but nothing
> happens.
>
> BTW, my main function in hello390.c is empty and I removed the printf
> call as it was dependent on correct serial port initialization while I
> am one step behind that for now.
>
> All I want to know If my _sdcc_external_startup is called. This
> function has nothing but clock init and controlling a LED using P1 SFR
> output pin.
> The assembly listing of the program shows that _sdcc_external_startup
> is linked but the debug LED mentioned in previous line does not glow
> (actually nothing happens at all).
>
> I hope somebody could point me in right direction.
> Thank you.
>
> PS:
> I am new to micro controller programming though have been working with
> ARM arch for some time.
>
> Arif M
> Singapore
>
-----Original Message-----
Hi,
I recommend to start with an empty main function and
just set and/or clear some outputs, preferably with a
LED connected, in _sdcc_external_startup().
Maarten
-----------------------------------------------------------
Hello Maarten,
Thanks for your email.
Your suggestion makes perfect sense and that is why I am already doing
the same. My hello390.c code looks like this
#include <stdio.h>
__sfr __at 0x92 WTST;// Program Wait States Register
unsigned char _sdcc_external_startup(void)
{
WTST = 0x00; //Set memory wait state
CKCON = 0x01; //Set Clock control
P1 = 0xFF; //ALL LEDs off
P1 &= (0x1<<4); //LED 4 ON
return 0;
}
void main (void) {
P1 &= (0x1<<5); //LED 5 ON
}
This code is very simple but it does not work for some reason. There is
no LED activity.
Please note that if I use -mmcs51 (basic 8051 mcu but without my
_sdcc_external_startup function) then LED control works well (using the
same P1 sfr as used above).
Thanks for your help.
Regards,
Arif
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user