Skip to content

Commit

Permalink
Aux memory section redefined.
Browse files Browse the repository at this point in the history
Max screens changed to 6.
6 positions in extra menu unlocked.
Allocation tests for Yenya
  • Loading branch information
qba667 committed Nov 22, 2017
1 parent 24f1cf6 commit 5ace7c1
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 15 deletions.
21 changes: 15 additions & 6 deletions source/MKL16Z64xxx4_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ SECTIONS
*(.mod_timerValue);
*(.mod_ticks100ms);
*(.mod_lastTimerUpdate);
*(.altconstVal);
*(.altconstVal);
*(.altinitPressure);
*(.altinitPressureRaw);
*(.mod_altconstVal);
*(.mod_altinitPressure);
*(.mod_altinitPressureRaw);
*(.mod_auxMem*)
KEEP(*(.AUX_MEM))
} > m_data
} > data


.mod_FLASH_25C8 0x25C8 :
Expand Down Expand Up @@ -237,7 +237,16 @@ SECTIONS
{
*(.reserved_after_eeprom);
}


.mod_freeSpaceAFHDSLogo 0xD50C :
{
*(.mod_yenyaSpace*);
}
.reserved_after_AFHDSLogo 0xD5F8 :
{
*(.reserved_after_AFHDSLogo);
}

. = ALIGN(4);

.mod_MOD_ALARMS 0xE140 :
Expand Down
Binary file modified source/build/org.bin
Binary file not shown.
23 changes: 20 additions & 3 deletions source/source/alt.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ int getSWState(uint32_t swIndex){

/*Belongs to .mod_modMenu 0xFFA0 */
void displayMenu(){
showNavPage((const char*) extraMenu, 5, (manuEntry*)menuList);
showNavPage((const char*) extraMenu, 6, (manuEntry*)menuList);
}

void BatteryType() {
Expand All @@ -392,8 +392,8 @@ void BatteryType() {
while (1) {
callSetupDMAandSend();
if(batteryVolt > 900) batteryVolt = 0;
displayPageHeader((char*)0xFFA8);
displayTextAt((char*)0xFF98, 8, 24,0);
displayPageHeader((char*)&txBat);
displayTextAt((char*)&alarm, 8, 24,0);
formatSensorValue(buffer, IBUS_MEAS_TYPE_INTV, batteryVolt);
displayTextAt((char*)buffer, 8, 32,0);
LCD_updateCALL();
Expand Down Expand Up @@ -907,6 +907,23 @@ void displaySensors(){

}

void testMethod(){
char buffer[32];
allocationTest = 100;
uint32_t key = 0;
while ( 1 )
{
callSetupDMAandSend();
displayPageHeader((char*)alarm);
LCD_updateCALL();
key = getKeyCode();
if (key == KEY_LONG_CANCEL)
{
break;
}
}
}

uint32_t mulu16(uint32_t x, uint32_t y)
{
uint32_t a = x >> 16;
Expand Down
10 changes: 7 additions & 3 deletions source/source/alt.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,19 @@ __attribute__((section (".mod_parseAC"))) void acData(uint8_t* rxBuffer);
__attribute__((section (".mod_swBHandling"))) void swBasADC();
__attribute__((section (".mod_loadModEeprom"))) void loadModSettings();
__attribute__((section (".mod_saveModEeprom"))) void saveModSettings();
__attribute__((section (".mod_yenyaSpace"))) void testMethod();


__attribute__((section (".mod_displaySensors"))) void displaySensors();
__attribute__((section (".mod_getSensorName"))) const uint8_t* getSensorName(int sensor);
__attribute__((section (".mod_formatSensorValue"))) void formatSensorValue(char* target, int sensorID, uint16_t sensorValue);
__attribute__((section (".mod_divMod"))) uint32_t divMod(uint32_t val, uint32_t divisor, uint32_t* mod);
__attribute__((section (".mod_parseCoord"))) void parseCoord(uint32_t *deg, uint32_t *min, uint32_t *sec, uint32_t *subSec, uint32_t coord);

__attribute__((section (".altconstVal"))) uint32_t constVal = 0;
__attribute__((section (".altinitPressure"))) uint32_t initPressure = 0;
__attribute__((section (".altinitPressureRaw"))) uint32_t initPressureRaw = 0;
__attribute__((section (".mod_altconstVal"))) uint32_t constVal = 0;
__attribute__((section (".mod_altinitPressure"))) uint32_t initPressure = 0;
__attribute__((section (".mod_altinitPressureRaw"))) uint32_t initPressureRaw = 0;
__attribute__((section (".mod_auxMem_test1"))) uint32_t allocationTest = 0;



Expand All @@ -138,6 +141,7 @@ __attribute__((section (".reserved_after_ac_sensor"))) uint32_t keep3 = 0;
__attribute__((section (".reserved_after_set_ch_val"))) uint32_t keep4 = 0;
__attribute__((section (".reserved_afterSwB_adac"))) uint32_t keep5 = 0;
__attribute__((section (".reserved_after_free_space_in_display"))) uint32_t keep6 = 0;
__attribute__((section (".reserved_after_AFHDSLogo"))) uint32_t keep7 = 0;
__attribute__((section (".reserved_after_free_space_in_display"))) uint16_t keepChecksum = 0;


Expand Down
2 changes: 1 addition & 1 deletion source/source/ibustelemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#define IBUS_MEAS_TYPE_GPS_LON 0x81 //4bytes signed WGS84 in degrees * 1E7
#define IBUS_MEAS_TYPE_GPS_ALT 0x82 //4bytes signed!!! GPS alt m*100
#define IBUS_MEAS_TYPE_ALT 0x83 //4bytes signed!!! Alt m*100
#define IBUS_MEAS_TYPE_ALT_MAX 0x84 //4bytes signed MaxAlt m*100
#define IBUS_MEAS_TYPE_ALT_MAX 0x84 //4bytes signed MaxAlt m*100
#define IBUS_MEAS_TYPE_S85 0x85
#define IBUS_MEAS_TYPE_S86 0x86
#define IBUS_MEAS_TYPE_S87 0x87
Expand Down
2 changes: 2 additions & 0 deletions source/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ int main(void) {
if(keep4==0){keep4++;}
if(keep5==0){keep5++;}
if(keep6==0){keep6++;}
if(keep7==0){keep7++;}

if(keepChecksum == 0){keepChecksum++;}
//keep this one because of without usage signature block will be removed
if(SIGNATURE[0] == 1){
Expand Down
14 changes: 12 additions & 2 deletions source/source/mod.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,17 @@ const uint8_t __attribute__((section (".mod_sensorsScreens"))) sensorsScreens[]
IBUS_MEAS_TYPE_GROUND_SPEED,
IBUS_MEAS_TYPE_VERTICAL_SPEED,
IBUS_MEAS_TYPE_CLIMB_RATE,
IBUS_MEAS_TYPE_RPM
IBUS_MEAS_TYPE_RPM,

IBUS_MEAS_TYPE_ALT_MAX,
IBUS_MEAS_TYPE_S85,
IBUS_MEAS_TYPE_S86,
IBUS_MEAS_TYPE_S87,
IBUS_MEAS_TYPE_S88,
IBUS_MEAS_TYPE_S89,
IBUS_MEAS_TYPE_S8a,
IBUS_MEAS_TYPE_UNKNOWN

};
const uint8_t __attribute__((section (".mod_timerFormat"))) timerFormat[] = {
'%', '0', '2', 'u', ':', '%', '0', '2', 'u', ':', '%', '0', '2', 'u', 0x00
Expand All @@ -195,7 +205,7 @@ const uint32_t __attribute__((section (".mod_modMenuList"))) menuList[] = {
SW_B_C, (uint32_t)(&SwBConfig+1),
(uint32_t)&txBat, (uint32_t)(&BatteryType+1),
AUX_CH_TEXT, (uint32_t)(&auxChannels2+1),
(uint32_t)&altSensor, (uint32_t)(&displayMenu+1),
(uint32_t)&altSensor, (uint32_t)(&testMethod+1),
};


Expand Down

3 comments on commit 5ace7c1

@Yenya
Copy link
Collaborator

@Yenya Yenya commented on 5ace7c1 Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kuba, this commit breaks build for me with the following error:

Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -Os -DNO_SWE -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -T "../MKL16Z64xxx4_flash.ld" -Xlinker --gc-sections -Wl,-Map,"fs-i6-noswe.map" --specs=nano.specs -specs=nosys.specs -Xlinker -z -Xlinker muldefs -o "fs-i6-noswe.elf"  ./utilities/fsl_debug_console.o ./utilities/fsl_notifier.o ./utilities/fsl_sbrk.o ./utilities/fsl_shell.o  ./startup/startup_MKL16Z4.o ./startup/system_MKL16Z4.o  ./source/adc.o ./source/alt.o ./source/backlight.o ./source/console.o ./source/debug.o ./source/flysky.o ./source/font.o ./source/lcd.o ./source/main.o ./source/mod.o ./source/print.o ./source/screen.o ./source/uart.o  ./drivers/fsl_adc16.o ./drivers/fsl_clock.o ./drivers/fsl_cmp.o ./drivers/fsl_common.o ./drivers/fsl_cop.o ./drivers/fsl_dac.o ./drivers/fsl_dma.o ./drivers/fsl_dmamux.o ./drivers/fsl_flash.o ./drivers/fsl_gpio.o ./drivers/fsl_i2c.o ./drivers/fsl_i2c_dma.o ./drivers/fsl_llwu.o ./drivers/fsl_lpsci.o ./drivers/fsl_lpsci_dma.o ./drivers/fsl_lptmr.o ./drivers/fsl_pit.o ./drivers/fsl_pmc.o ./drivers/fsl_rcm.o ./drivers/fsl_rtc.o ./drivers/fsl_sai.o ./drivers/fsl_sai_dma.o ./drivers/fsl_sim.o ./drivers/fsl_smc.o ./drivers/fsl_spi.o ./drivers/fsl_spi_dma.o ./drivers/fsl_tpm.o ./drivers/fsl_tsi_v4.o ./drivers/fsl_uart.o ./drivers/fsl_uart_dma.o  ./board/board.o ./board/clock_config.o ./board/pin_mux.o   
/usr/lib/gcc/arm-none-eabi/7.1.0/../../../../arm-none-eabi/bin/ld:../MKL16Z64xxx4_flash.ld:133: warning: memory region `data' not declared
/usr/lib/gcc/arm-none-eabi/7.1.0/../../../../arm-none-eabi/bin/ld: section .AUX_MEM VMA [0000000020000f4a,0000000020000fb3] overlaps section .bss VMA [0000000020000e40,000000002000103b]
collect2: error: ld returned 1 exit status
makefile:76: recipe for target 'fs-i6-noswe.elf' failed
make: *** [fs-i6-noswe.elf] Error 1

@qba667
Copy link
Owner Author

@qba667 qba667 commented on 5ace7c1 Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yenya how about now
(1 parent b55b522 commit 236f8c5)?
My GCC/linker seems to be ignoring those names.

@Yenya
Copy link
Collaborator

@Yenya Yenya commented on 5ace7c1 Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It compiles now. Thanks for the fast response.

Please sign in to comment.