2019-08-11 21:39:11 -04:00
|
|
|
/*************************************************************************
|
|
|
|
|
* 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/>.
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
2019-08-14 01:52:10 -04:00
|
|
|
* @file memory.h
|
2019-08-11 21:39:11 -04:00
|
|
|
* @author Justin Byers
|
|
|
|
|
* @date August 11, 2019
|
2019-08-14 01:52:10 -04:00
|
|
|
* @brief Program flash memory addresses of data relocated to work with the bootloader.
|
2019-08-11 21:39:11 -04:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
#ifndef MEMORY_
|
|
|
|
|
#define MEMORY_
|
|
|
|
|
|
2019-08-14 01:52:10 -04:00
|
|
|
/**
|
|
|
|
|
* 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:
|
|
|
|
|
*
|
|
|
|
|
*/
|
2019-08-11 21:39:11 -04:00
|
|
|
|
2019-08-14 01:52:10 -04:00
|
|
|
/**
|
|
|
|
|
* The base address of the application memory space. The application's reset vector will be
|
|
|
|
|
* at this address.
|
|
|
|
|
*/
|
|
|
|
|
#define APP_FW_MEMORY_OFFSET 0x2000
|
2019-08-11 21:39:11 -04:00
|
|
|
|
2019-08-14 01:52:10 -04:00
|
|
|
/**
|
|
|
|
|
* The address in application memory space that stores the application's version number.
|
|
|
|
|
*/
|
2019-08-13 22:52:23 -04:00
|
|
|
#define APP_FW_VERSION_ADDRESS (APP_FW_MEMORY_OFFSET + 0x16)
|
|
|
|
|
|
2019-08-14 01:52:10 -04:00
|
|
|
/**
|
|
|
|
|
* 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
|
2019-08-11 21:39:11 -04:00
|
|
|
|
|
|
|
|
#endif /* MEMORY_ */
|
|
|
|
|
|