Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma CODE_SECTION(C28flash_InitFlash,ramFuncSection);
- void C28flash_InitFlash (void){
- Uint32 i;
- InitFlash(); // Tune waitstates
- CsmUnlock(); // Unlock CSM (not necessary right now)
- FlashGainPump(); // Gain Pump from M3
- for (i=0;i<1024;i++){
- flashData.dataBuffer[i] = i;
- }
- flashData.numOfWords = 1024;
- flashData.flashAddress = 0x128000;
- // Запрет ECC
- EALLOW;
- FlashEccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
- EDIS;
- Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 150); // Init API
- Fapi_setActiveFlashBank(Fapi_FlashBank0); // Chose flash bank (we only have "bank 0" on C28)
- Fapi_getBankSectors(Fapi_FlashBank0, &F28M35flash); // Get info about sector structure on C28
- // Fill test buffer to be flashed
- /* for (i=0;i<1024;i++){
- flashData1.dataBuffer[i] = i;
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment