
?
?
?
?
4.4 Creating ? an ? Application ? for ? the ? Badge ?
To ? create ? software ? that ? can ? be ? downloaded ? to ? the ? badge ? using ? the ? bootloader, ? there ? are ? a ? few ?
guidelines ? that ? must ? be ? met. ? The ? LEDApp.zip ? and ? JM_Badge_Board.zip ? CodeWarrior ? projects ? have ?
been ? provided ? as ? templates ? for ? development. ? It ? is ? highly ? recommended ? to ? start ? custom ? software ?
designs ? with ? one ? of ? those ? projects. ?
4.4.1 Software ? Requirements ?
There ? are ? several ? important ? things ? that ? must ? be ? done ? for ? a ? custom ? application ? to ? download ? and ?
work ? correctly ? with ? the ? badge ? bootloader. ? This ? includes ? setting ? up ? the ? interrupts, ? ensuring ? the ?
code ? is ? called ? from ? the ? correct ? place, ? and ? checking ? the ? code ? size. ?
4.4.1.1 Interrupts ?
All ? interrupts ? that ? will ? be ? used ? in ? the ? project ? must ? be ? declared ? in ? the ? main.c ? file. ? This ? file ? can ? be ?
found ? in ? <Project ? Directory>/Sources/main.c ?
?
In ? that ? file, ? there ? is ? an ? array ? called ? “RAM_vector[]” ? that ? contains ? the ? re ‐ directs ? to ? all ? the ?
interrupt ? handler ? routines. ? For ? the ? interrupt ? that ? is ? to ? be ? used, ? replace ? “dummy_ISR” ? with ? the ?
name ? of ? the ? interrupt ? function ? that ? should ? be ? used ? instead. ?
?
For ? example, ? in ? the ? LED_App ? project, ? the ? RTC ? interrupt ? (Vector ? 91) ? is ? using ? the ? “rtc_interrupt” ?
function. ? This ? function ? will ? be ? called ? any ? time ? an ? RTC ? interrupt ? occurs. ? This ? is ? the ? only ? change ?
that ? is ? required ? that ? is ? specific ? to ? the ? badge ? board ? in ? order ? to ? use ? interrupts. ?
4.4.1.2 Application ? Code ?
All ? user ? application ? code ? must ? be ? called ? from ? a ? specific ? place ? in ? main.c. ? This ? file ? can ? be ? found ? in ?
<Project ? Directory>/Sources/main.c ?
?
In ? the ? main(void) ? function, ? there ? are ? two ? large ? comment ? blocks ? that ? signal ? the ? beginning ? and ?
end ? of ? where ? the ? application ? code ? should ? begin ? and ? end ? executing. ? The ? code ? may ? call ? any ?
functions ? from ? within ? this ? block, ? so ? there ? is ? no ? need ? to ? put ? all ? the ? code ? in ? the ? main.c ? file. ??
4.4.1.3 Code ? Size ?
As ? can ? be ? seen ? in ? the ? project.lcf ? linker ? file, ? the ? bootloader ? takes ? up ? the ? flash ? addresses ? from ?
0x00000000 ? to ? 0x00003800. ? This ? leaves ? addresses ? 0x00003800 ? to ? 0x00020000 ? for ? application ?
code. ? There ? is ? also ? 0x3E00 ? bytes ? of ? RAM ? space ? available ? located ? from ? 0x00800200 ? to ?
0x00804000. ?? See ? the ? linker ? file ? for ? more ? information. ?
4.4.2 Loading ? Application ? onto ? Badge ? Board ?
See ? Section ? 4.3.1 ? for ? how ? to ? use ? get ? an ? S19 ? file ? and ? load ? it ? on ? the ? board. ?
?
?
JM ? Badge ? Board ? User’s ? Manual ?
Page ? 15 ? of ? 18 ?