Code Snippet 1:
When I "Build" the code, I got following errors.
#include "Bootloader.h"
#include "IFsh1.h"
#include "S19.h"
#include "Shell.h"
#include "WAIT1.h"
#include "LEDR.h"
#include "UTIL1.h"
#include "AS1.h"
#include "KIN1.h"
#define FLASH_PAGE_SIZE (IntFlashLdd1_ERASABLE_UNIT_SIZE) /* flash page size */
#define BL_FLASH_VECTOR_TABLE 0x0000 /* bootloader vector table in flash */
#define MIN_APP_FLASH_ADDRESS 0x1000 /* start of application flash area */
#define MAX_APP_FLASH_ADDRESS 0x7FFFF /* end of application flash */
#define APP_FLASH_VECTOR_START 0x1000 /* application vector table in flash */
#define APP_FLASH_VECTOR_SIZE 0x410 /* size of vector table */
.
.
.
.
Code Snippet 2:
#include "BL_SW.h"
#include "PORT_PDD.h"
static bool BL_CheckBootloaderMode(void) {
SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK |
SIM_SCGC5_PORTB_MASK |
SIM_SCGC5_PORTC_MASK |
SIM_SCGC5_PORTD_MASK |
SIM_SCGC5_PORTE_MASK;
#if 0
GPIOB_PDDR = (uint32_t)((GPIOB_PDDR & (uint32_t)~0x0100UL) | (uint32_t)0x00UL);
PORTB_PCR1 = (uint32_t)((PORTB_PCR1 & (uint32_t)~0x01000600UL) | (uint32_t)0x0100UL);
#else
(void)BitIoLdd1_Init(NULL);
PORT_PDD_EnablePullupLowPortMask(PORTB_BASE_PTR, 1, PORT_PDD_PULL_UP);
PORT_PDD_SetPinPullEnable(PORTB_BASE_PTR, 1, PORT_PDD_PULL_ENABLE);
WAIT1_Waitms(5);
#endif
if (!BL_SW_GetVal()) {
WAIT1_Waitms(50);
if (!BL_SW_GetVal()) {
return TRUE;
}
}
return FALSE;
}
In The Above 2 Code Snippets, error was thrown when I "build" my project in Kinetis Design Studio IDE. The statements which threw error are marked in
BOLD font style.
The error statement in code snippet 1 is:
Quote:
Multiple markers at this line
- 'IntFlashLdd1_ERASABLE_UNIT_SIZE' undeclared (first use in this
function)
- each undeclared identifier is reported only once for each function it
appears in
The error statement in code snippet 2 is:
2.A
Quote:
Multiple markers at this line
- 'SIM_SCGC5' undeclared (first use in this function)
- 'SIM_SCGC5_PORTA_MASK' undeclared (first use in this
function)
- 'SIM_SCGC5_PORTB_MASK' undeclared (first use in this
function)
- 'SIM_SCGC5_PORTC_MASK' undeclared (first use in this
function)
- 'SIM_SCGC5_PORTD_MASK' undeclared (first use in this
function)
- 'SIM_SCGC5_PORTE_MASK' undeclared (first use in this
function)
2.B
Quote:
Multiple markers at this line
- 'PORTB_BASE_PTR' undeclared (first use in this
function)
Quote:
Multiple markers at this line
- in expansion of macro 'PORT_PDD_SetPinPullEnable'
- implicit declaration of function 'PORT_PCR_REG' [-Wimplicit-function-
declaration]
What I have tried:
I am using
Hardware: MKE02Z64VLD2
IDE: Kinetis Design Studio.
BL_SW: PTB1
I posted this doubt in many forums and they said, the syntax is not supporting the Kinetis E series controller. They asked me to refer the reference manual of the Kinetis E series controller. But in the reference manual I could not find the proper syntax to fix these errors.
In a nutshell,
In the code snippet 1, I am trying to define a variable for Flash Page Size, but the bad syntax is not supporting KE-02Z controller.
In the code snippet 2, the operation which I am trying to perform with the code snippet 2 is Clocking all the Port Pins, Configuring the PORTB Pin1 (PTB1) as input and, Initialize the port pin PTB1, Enable internal pull-up on PTB1 followed by simple wait statements.
And the Problem with the code snippet 2 is those SIM instruction wont support Kinetis E series controller and the Port Pins are automatically clocked by default after reset. So those 5 statements can just be deleted right ?
Next Error occurs at statements pertaining to enabling the Internal Pull up. How to fix it ?
(Sorry for the long question, my question is pretty straightforward but to make the reader understand my question is quite difficult.)
Thanks in advance.