/*
 * binary_packer.c
 *
 *  Created on: Jun 29, 2022
 *      Author: Invcuser52
 */


#include "bin_header_def.h"
#include "version.h"


//#define EXECUTE_FROM_SAME_MEM


#define MDL_ID 0x000000001 // module id

#ifdef EXECUTE_FROM_SAME_MEM
/* the key 0xAABBCCDD indicates binary execute from same location where it is stored by OTSU */
#define CODE_MEM_ALLOC 0xAABBCCDD
#else
#define CODE_MEM_ALLOC 0x08010000
#endif

#define DAT_MEM_ALLOC  0x20009000

#define SW_VERSION_BIN  (uint32_t)((VER_u8DATA_SW_MAJOR << 8) | (VER_u8DATA_SW_MINOR))

volatile s_binary_header_def bin_header_info __attribute__((section(".hdrinfo"))) =
 {
		 MDL_ID,           			 // Module_ID = 0x16
		 SW_VERSION_BIN,     		 // Software version = 01.08
		 0x12052022, 	    		 // build date = 12/05/2022
		 0xCCCCCCCC,     			 // code size   , will be updated by binary packer script
		 0xDDDDDDDD,        		 // data size	, will be updated by binary packet script
		 STATIC_LOAD_ENABLE_CODE, 	 // Loader selection for code
		 STATIC_LOAD_ENABLE_DATA,    // Loader selection for data
		 CODE_SEC_EXE_INT_FLASH,     // Destination load area for Code section
		 DATA_SEC_EXE_INT_RAM,       // Destination load area for Data/Bss section
		 CODE_MEM_ALLOC,       		 // Static load address for Code
		 DAT_MEM_ALLOC,       		 // Static load address for Data/Bss
 };



void bin_init()
{
	uint32_t temp = bin_header_info.module_id;
	temp = temp;
}
