|
 UltimaSerial
Windaq Add-ons
UltimaWaterfall
XChart
FFT1024

Lessons |
|
Here is a practice
to move codes from project test2 to test1 Preparation:
-
Start AVR32 Studio
-
Right click inside Project Explorer
-
Follow New->Example...->EVK1100-Services->LWIP
example to create a project name test1
-
Repeat step 1 to 3 to create a new project test2
based on EVK1100->COMPONENTS->Data Flash Memory example
-
Build both
-
Right click project test1, follow Run/Debug
Settings->New...->AVR32 Application, select the proper Target,
for example JTAGICE mkII
-
Repeat 6 on test2
-
Make sure both test1 and test2 run properly on the
target
Combine the two projects by copy-and-pasting codes from
test2 to test1. The following copy-and-paste are done inside AVR32 studio,
not Window's File Explorer. Make sure keeping the same file/folder
structure
-
Copy two files test2->src->CONFIG->conf_access.h
and conf_at45dbx.h from test2 to the same CONFIG folder under test1
-
Copy test2->src->SOFTWARE_FRAMEWORK->COMPONENTS->MEMORY
folder to test1
-
Copy test2->src->SOFTWARE_FRAMEWORK->DRIVERS->SPI
folder to test1
-
Copy test2->src->SOFTWARE_FRAMEWORK->DRIVERS->USART
folder to test1
-
Copy test2->src->SOFTWARE_FRAMEWORK->SERVICES->MEMORY
folder to test1
-
Copy test2->src->SOFTWARE_FRAMEWORK->UTILS->DEBUG
folder to test1
Examine directory path used by test2
-
Right click on test2, follow Properties->C/C++
General->Paths and Symbols
-
Select All for Configuration
-
Select GNU C in Languages pane, and you should see all
the directories used by test2.

Copy *ALL* directory path used by test2 to test1
-
src/SOFTWARE_FRAMEWORK/UTILS/DEBUG
-
src/SOFTWARE_FRAMEWORK/SERVICES/MEMORY/CTRL_ACCESS
-
src/SOFTWARE_FRAMEWORK/DRIVERS/SPI
-
src/SOFTWARE_FRAMEWORK/DRIVERS/USART
-
src/SOFTWARE_FRAMEWORK/COMPONENTS/MEMORY/DATA_FLASH/AT45DBX
Copy codes from test2::main.c to test1to confirm a
successful transplant
-
Open at45dbx_example.c under project test2
-
Copy the include files from test2 to test1
#include "compiler.h"
#include "preprocessor.h"
#include "board.h"
#include "gpio.h"
#include "spi.h"
#include "print_funcs.h"
#include "conf_at45dbx.h"
#include "at45dbx.h"
-
Copy everything after #include "at45dbx.h",
before int main (void) from test2
-
Copy everything in main() of test2 and paste to the
main() of test1 so that it looks like this:
int
main( void
)
{
volatile avr32_pm_t* pm =
&AVR32_PM;
/* 1) Initialize
the microcontroller and the shared hardware resources of the
board. */
/* Switch to
external oscillator 0 */
pm_switch_to_osc0( pm, FOSC0, OSC0_STARTUP );
init_dbg_rs232(FOSC0);
print_dbg(MSG_WELCOME);
// Initialize
AT45DBX resources: GPIO, SPI and AT45DBX.
at45dbx_resources_init();
// Perform a
memory check on all DFs.
print_dbg( "Entering
Memory Check:\n");
at45dbx_example_check_mem();
// Test
single-byte access functions.
print_dbg( "Entering
Memory Test (Byte Access):\n");
at45dbx_example_test_byte_mem();
// Test
single-sector access functions.
print_dbg( "Entering
Memory Test (RAM Access):\n");
at45dbx_example_test_RAM_mem();
// Test
multiple-sector access functions.
print_dbg( "Entering
Multiple Sector Test:\n");
at45dbx_example_test_multiple_sector();
Build test1 and run
Note: If you've changed some
derived definition files in the source project, such as EVK1100.h, make
sure carrying them over to the target project
|