Jump to content

18F4682 Processor Mismatch, large Codesize, Memory Questions


Recommended Posts

Posted (edited)

3.Questions:

 

1.how to get the processor match:

warning: processor mismatch in "mulint.o"
warning: processor mismatch in "moduint.o"

 

i controll the enviroment variables:

printenv PROCESSOR
18F4685

 

>this is ok i first thougt... but because never knows... I changed the letter "F" to "f" so i get:

printenv PROCESSOR
18f4685

 

the processor is still mismatching:

jo@esliegtdaschnee:~/C/8_tekkstar1D$ make
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/bash ./bin/mios-gpasm -c -p p18f4685 -I./src -I ./include/asm -I ./include/share -I ./modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE -I ./modules/mios_wrapper modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
/bin/bash ./bin/mios-gpasm -c -p p18f4685 -I./src -I ./include/asm -I ./include/share -I ./modules/app_lcd/dummy -DDEBUG_MODE=0   modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o
/bin/bash ./bin/mios-sdcc -c -mpic16 -p18f4685 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I ./include/c -I ./include/share -DDEBUG_MODE=0  main.c -o _output/main.o
./bin/mios-gpasm modifies _output/main.asm, result in _output/main__mios-gpasm-tmp.asm
_output/main__mios-gpasm-tmp.asm:1346:Warning [231] No memory has been reserved by this instruction.
gplink -s ./etc/lkr/p18f4685.lkr -m -o project.hex  ./lib/libsdcc.lib ./lib/pic18f4685.lib _output/mios_wrapper.o _output/app_lcd.o _output/main.o
warning: processor mismatch in "mulint.o"
warning: processor mismatch in "moduint.o"

 

 

makefile:

MIOS_PATH = .
MIOS_BIN_PATH = ./bin
export MIOS_PATH
export MIOS_BIN_PATH
include Makefile.orig
MIOS_WRAPPER_DEFINES = -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE

makefile.orginal:

# define the processor, linker file and project name
PROCESSOR = 18f4685
LKR_FILE  = $(MIOS_PATH)/etc/lkr/p$(PROCESSOR).lkr
PROJECT   = project
# list of objects that should be created and linked
OBJS = mios_wrapper.o app_lcd.o main.o
# include pathes (more will be added by .mk files)
GPASM_INCLUDE = 
SDCC_INCLUDE  = 
# optional defines that should be passed to GPASM/SDCC
GPASM_DEFINES = -DDEBUG_MODE=0
SDCC_DEFINES  = -DDEBUG_MODE=0
# pass parameters to MIOS wrapper
MIOS_WRAPPER_DEFINES = -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f
# directories and files that should be part of the distribution (release) package
# more will be added by *.mk files
DIST = ./
# include the common.mk file
include $(MIOS_PATH)/include/makefile/common.mk
# include application specific driver (select app_lcd/dummy if MIOS internal driver used)
include $(MIOS_PATH)/modules/app_lcd/dummy/app_lcd....

 

2.Code Memory:(96k flash, 1k EEPROM, 3328 bytes RAM)

How much can i write into the  Flash memory? all the 96K? how much is mios?

if I use much Arrays, and i need them all in the program, and the acces should be quick, so i cant save them into bankstick... and my program needs about 90kB Pic-Flash- is this a problem?

if i use the arrays normal: i define them as global variable, initalise it by startup - are thes variables then in Flash or in Ram? (i am a newbee in this things, up to now i didnt have to worry about that...)

 

by the way i shrinked the code need from 30528B to 23040 by changing the variables from "int" to "unsigned char"....

 

3.Errors while compiling:

I use now a pic18F4682, because the 18F452 went to small in CodeFlash....

I recently added more code to the program from 30kB to ...

 

Codesize 20kB and 30kB, (size is that what is shown in Mios studio as PIC-FLASH)

Compiled, program made/running, but error:

processor  mismatch? But ok i can life with it.... up to the point when i need more memory

crimic@DELL:~/C/8_tekkstar1D$ make
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/bash ./bin/mios-gpasm -c -p p18f4685 -I./src -I ./include/asm -I ./include/share -I ./modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE -I ./modules/mios_wrapper modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
/bin/bash ./bin/mios-gpasm -c -p p18f4685 -I./src -I ./include/asm -I ./include/share -I ./modules/app_lcd/dummy -DDEBUG_MODE=0   modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o
/bin/bash ./bin/mios-sdcc -c -mpic16 -p18f4685 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I ./include/c -I ./include/share -DDEBUG_MODE=0  main.c -o _output/main.o
./bin/mios-gpasm modifies _output/main.asm, result in _output/main__mios-gpasm-tmp.asm
_output/main__mios-gpasm-tmp.asm:1346:Warning [231] No memory has been reserved by this instruction.
gplink -s ./etc/lkr/p18f4685.lkr -m -o project.hex  ./lib/libsdcc.lib ./lib/pic18f4685.lib _output/mios_wrapper.o _output/app_lcd.o _output/main.o
warning: processor mismatch in "mulint.o"
warning: processor mismatch in "moduint.o"

 

Codesize 40kB-90kB, (size is that what is shown in Mios studio as PIC-FLASH)

aha@nasupa:~/C/8_tekkstar1D$ make
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/bash ./bin/mios-gpasm -c -p p18f4685 -I./src -I ./include/asm -I ./include/share -I ./modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE -I ./modules/mios_wrapper modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
/bin/bash ./bin/mios-gpasm -c -p p18f4685 -I./src -I ./include/asm -I ./include/share -I ./modules/app_lcd/dummy -DDEBUG_MODE=0   modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o
/bin/bash ./bin/mios-sdcc -c -mpic16 -p18f4685 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I ./include/c -I ./include/share -DDEBUG_MODE=0  main.c -o _output/main.o
make: *** [_output/main.o] Fehler 1
aha@nasupa:~/C/8_tekkstar1D$

 

With Code over 96K, i get this error:

aha@nasupa:~/C/8_tekkstar1D$ make
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/bash ./bin/mios-gpasm -c -p p18f4685 -I./src -I ./include/asm -I ./include/share -I ./modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE -I ./modules/mios_wrapper modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
/bin/bash ./bin/mios-gpasm -c -p p18f4685 -I./src -I ./include/asm -I ./include/share -I ./modules/app_lcd/dummy -DDEBUG_MODE=0   modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o
/bin/bash ./bin/mios-sdcc -c -mpic16 -p18f4685 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I ./include/c -I ./include/share -DDEBUG_MODE=0  main.c -o _output/main.o
./bin/mios-sdcc: Zeile 18:  5784 Getötet                sdcc --asm="${MIOS_SHELL} ${MIOS_BIN_PATH}/mios-gpasm -fixasm" $@
make: *** [_output/main.o] Fehler 137

"Zeile 18" or english "Line 18" in mios-sdcc:

sdcc --asm="${MIOS_SHELL} ${MIOS_BIN_PATH}/mios-gpasm -fixasm" $@

"5784 getötet" or english "5784 killed"
 ---ok i understand this---to much for this chip ;)

Edited by Phatline
Posted (edited)

According to the wiki the processor option should be formatted like: -p18F4685. I see in your cmd example that gpasm is using -p p18F4685.

Edited by Shuriken
Posted

The warnings can be ignored

 

Your other questions actually need your source code as reference for an accurate answer, and some time for the guy who analysis your code and gives you proposals...

 

However, all those memory limitations and C compiler quirks where a strong reason why I moved to the MIOS32 platform more than 5 years ago (!) which is much more comfortable to use :smile:

It was your idea to use the old PIC based platform ;)

 

Best Regards, Thorsten.

Posted

:yes: jo eh - i already thougt, that this project grows in a to complex way...first pic18f452 then trying one of this bigFlash-Sid-Pics....and now still not enough resources... you are right... lucky me that i have LPCs and vectorboards laying around>strip it down to smalles possible...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...