Files
bia_microddr_fw/common_src/memory.h

66 lines
2.2 KiB
C

/*************************************************************************
* Copyright (C) 2019 by Justin Byers
*
* This file is part of clubdance_v2.
*
* clubdance_v2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* clubdance_v2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with clubdance_v2. If not, see <https://www.gnu.org/licenses/>.
*************************************************************************/
/**
* @file memory.h
* @author Justin Byers
* @date August 11, 2019
* @brief Program flash memory addresses of data relocated to work with the bootloader.
*
*/
#ifndef MEMORY_
#define MEMORY_
/**
* When changing the location of the application in flash memory these files and settings
* must be updated.
* In bootloader project:
* VectorRemap.asm HiVector goto -> APP_FW_MEMORY_OFFSET + 0x08
* LoVector goto -> APP_FW_MEMORY_OFFSET + 0x18
* Configuration > Linker > Memory Model > ROM space -> default,-APP_FW_MEMORY_OFFSET-7FFF
* In application project:
*
*/
/**
* The base address of the application memory space. The application's reset vector will be
* at this address.
*/
#define APP_FW_MEMORY_OFFSET 0x2000
/**
* The address in application memory space that stores the application's version number.
*/
#define APP_FW_VERSION_ADDRESS (APP_FW_MEMORY_OFFSET + 0x16)
/**
* The address in application memory space that stores the signature word written by
* the bootloader after a sucessful flash of application firmware.
*/
#define APP_SIGNATURE_ADDRESS (APP_FW_MEMORY_OFFSET + 0x06)
/**
* The absolute address of the bootloader entrypoint. The application can jump to the
* bootloader by executing a "goto" instruction with this address.
*/
#define BOOTLOADER_ENTRYPOINT 0x001C
#endif /* MEMORY_ */