NXP SDK EEPROM code Error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

NXP SDK EEPROM code Error

ソリューションへジャンプ
1,979件の閲覧回数
CEPL_Dev
Contributor III

I was trying to configure the Flash module of MKE18F512VLL16 MCU to be used as an EEPROM. I used the NXP SDK, but I'm getting the following dependency errors although I selected to auto resolve all pack requirements while including the drivers in the project. A lot of macros seem to be undefined.

 
Rebuild started: Project: mke18_flash
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'Target 1'
assembling startup_MKE18F16.s...
compiling fsl_ftfx_flash.c...
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(82): warning:  #1296-D: extended constant initialiser used
  static volatile uint32_t *const kFPROTL = (volatile uint32_t *)(uint32_t)&FTFx_FPROT_LOW_REG;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(582): warning:  #186-D: pointless comparison of unsigned integer with zero
          for (uint32_t i = 0U; i < (uint32_t)MAX_FLASH_PROT_REGION_COUNT;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(617): warning:  #1296-D: extended constant initialiser used
          static volatile uint32_t *const kFPROTLx = (volatile uint32_t *)(uint32_t)&FTFx_FPROTL3_REG;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(633): warning:  #186-D: pointless comparison of unsigned integer with zero
                  if (regionCounter < (uint32_t)MAX_FLASH_PROT_REGION_COUNT)
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1147): error:  #20: identifier "FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL" is undefined
      config->flashDesc.feature.hasXaccControl = FSL_FEATURE_FLASH_HAS_ACCESS_CONTROL;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1181): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_START_ADDRESS" is undefined
          pflashStartAddress        = FLASH0_FEATURE_PFLASH_START_ADDRESS; /* get P-Flash start address */
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1182): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE" is undefined
          pflashBlockSize           = FLASH0_FEATURE_PFLASH_BLOCK_SIZE;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1183): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_BLOCK_COUNT" is undefined
          pflashBlockCount          = FLASH0_FEATURE_PFLASH_BLOCK_COUNT;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1184): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE" is undefined
          pflashBlockSectorSize     = FLASH0_FEATURE_PFLASH_BLOCK_SECTOR_SIZE;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1185): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_BLOCK_WRITE_UNIT_SIZE" is undefined
          pflashBlockWriteUnitSize  = FLASH0_FEATURE_PFLASH_BLOCK_WRITE_UNIT_SIZE;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1186): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT" is undefined
          pflashSectorCmdAlignment  = FLASH0_FEATURE_PFLASH_SECTOR_CMD_ADDRESS_ALIGMENT;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1187): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT" is undefined
          pflashSectionCmdAlignment = FLASH0_FEATURE_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1222): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_RESOURCE_CMD_ADDRESS_ALIGMENT" is undefined
          (uint8_t)FSL_FEATURE_FLASH_PFLASH_RESOURCE_CMD_ADDRESS_ALIGMENT;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1225): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_CHECK_CMD_ADDRESS_ALIGMENT" is undefined
          (uint8_t)FSL_FEATURE_FLASH_PFLASH_CHECK_CMD_ADDRESS_ALIGMENT;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1228): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_SWAP_CONTROL_CMD_ADDRESS_ALIGMENT" is undefined
          (uint8_t)FSL_FEATURE_FLASH_PFLASH_SWAP_CONTROL_CMD_ADDRESS_ALIGMENT;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c(1274): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_PROTECTION_REGION_COUNT" is undefined
          pflashProtectionRegionCount = FLASH0_FEATURE_PFLASH_PROTECTION_REGION_COUNT;

C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_flash.c: 4 warnings, 12 errors
compiling fsl_ftfx_controller.c...
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_controller.c(158): warning:  #1296-D: extended constant initialiser used
  static volatile uint32_t *const kFCCOBx = (volatile uint32_t *)(uint32_t)&FTFx_FCCOB3_REG;
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_controller.c(197): error:  #20: identifier "FSL_FEATURE_FLASH_FLEX_RAM_START_ADDRESS" is undefined
      config->flexramBlockBase                = FSL_FEATURE_FLASH_FLEX_RAM_START_ADDRESS;

C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_controller.c(198): error:  #20: identifier "FSL_FEATURE_FLASH_FLEX_RAM_SIZE" is undefined
      config->flexramTotalSize                = FSL_FEATURE_FLASH_FLEX_RAM_SIZE;

C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\drivers\fsl_ftfx_controller.c: 1 warning, 2 errors
compiling main.c...
compiling fsl_ftfx_cache.c...
compiling system_MKE18F16.c...
compiling fsl_common.c...
compiling fsl_clock.c...
compiling fsl_ftfx_flexnvm.c...
compiling flash_adapter.c...
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\components\internal_flash\flash.h(93): warning:  #66-D: enumeration value is out of "int" range
      kHAL_Flash_SecurityStateNotSecure        = 0xc33cc33cU, /*!< Flash is not secure.*/
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\components\internal_flash\flash_adapter.c(75): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_BLOCK_WRITE_UNIT_SIZE" is undefined
      uint32_t progBuf[PGM_SIZE_BYTE / sizeof(uint32_t)];
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\components\internal_flash\flash_adapter.c(193): error:  #20: identifier "FSL_FEATURE_FLASH_PFLASH_BLOCK_WRITE_UNIT_SIZE" is undefined
      uint8_t buffer[PGM_SIZE_BYTE];
C:\Keil_v5\ARM\PACK\NXP\MKE18F16_DFP\12.2.0\components\internal_flash\flash_adapter.c: 1 warning, 2 errors
".\Objects\mke18_flash.axf" - 16 Error(s), 6 Warning(s).
Target not created.
Build Time Elapsed:  00:00:03
 
Regards
Prasanth
0 件の賞賛
1 解決策
1,949件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

If you use keil to choose the peripheral, the code will use the sdk it downloaded by keil. So this operation will cause some problems. I recommend you use our mcuxpresso. Use this ide to configure your peripheral.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

元の投稿で解決策を見る

6 返答(返信)
1,975件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

You should download the sdk in https://mcuxpresso.nxp.com/en/select

In the directory 'SDK_2.6.0_MKE18F256xxx16\boards\twrke18f\driver_examples\flash\flexnvm_eeprom\mdk', you will find the eeprom example.

The sdk downloaded by keil may have some problems.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,973件の閲覧回数
CEPL_Dev
Contributor III

Hi @nxf56274 ,

Thanks for the reply.

I've downloaded the SDK (SDK_2.8.0_MKE18F512xxx16\boards\twrke18f\driver_examples\flash\flexnvm_eeprom\mdk) and the example is compiling without errors.

CEPL_Dev_0-1602316818051.png

 

This is how I've added the NXP SDK Peripheral Driver to my project through Software Component Selector tool in Keil MDK.

How to use the newly downloaded peripheral driver (SDK_2.8.0_MKE18F512xxx16) in my project? 

Regards
Prasanth
1,950件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

If you use keil to choose the peripheral, the code will use the sdk it downloaded by keil. So this operation will cause some problems. I recommend you use our mcuxpresso. Use this ide to configure your peripheral.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,926件の閲覧回数
CEPL_Dev
Contributor III

I switched to MCUXpresso for further development and manually ported my source files to a MCUXpresso project. SDK Drivers are working well now.

Regards
Prasanth
0 件の賞賛
1,943件の閲覧回数
CEPL_Dev
Contributor III

Hi @nxf56274,

 

The problem is that I've a complete working firmware for a product developed using Keil. Now I've to add just the EEPROM functionality to this. That's the reason why I'm sticking to keil MDK.

Is there any way to port Keil projects to MCUexpresso projects? Can we use ULink 2 debugger with MCUexpresso?

Regards
Prasanth
0 件の賞賛
1,938件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

You just need add the necessary file to your keil project. In the sdk, copy the file you need under the directory 'drivers' to your own project. In your own project, when the sdk report some error like lacking of the definition, you can copy this definition and search this definition in our sdk. Then you will know what file you lack of.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛