Исправлена загрузка в данных в флэш память

This commit is contained in:
sedov 2024-08-06 11:12:00 +03:00
parent a25e83f604
commit 59f057398b
17 changed files with 4803 additions and 4946 deletions

View File

@ -8,14 +8,14 @@ SHELL = cmd.exe
%.obj: ../%.c $(GEN_OPTS) | $(GEN_FILES) $(GEN_MISC_FILES)
@echo 'Building file: "$<"'
@echo 'Invoking: C2000 Compiler'
"C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --idiv_support=idiv0 --tmu_support=tmu0 --vcu_support=vcrc -Ooff --opt_for_speed=2 --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/emif1_ex1_16bit_asram" --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/common/include" --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/headers/include" --include_path="C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/include" --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="$(basename $(<F)).d_raw" $(GEN_OPTS__FLAG) "$<"
"C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --idiv_support=idiv0 --tmu_support=tmu0 --vcu_support=vcrc -Ooff --opt_for_speed=2 --include_path="C:/Users/sedov/Desktop/T/FLASH MX29LV160DBTI-70G/emif1_ex1_16bit_asram" --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/common/include" --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/headers/include" --include_path="C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/include" --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="$(basename $(<F)).d_raw" $(GEN_OPTS__FLAG) "$<"
@echo 'Finished building: "$<"'
@echo ' '
%.obj: ../%.asm $(GEN_OPTS) | $(GEN_FILES) $(GEN_MISC_FILES)
@echo 'Building file: "$<"'
@echo 'Invoking: C2000 Compiler'
"C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --idiv_support=idiv0 --tmu_support=tmu0 --vcu_support=vcrc -Ooff --opt_for_speed=2 --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/emif1_ex1_16bit_asram" --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/common/include" --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/headers/include" --include_path="C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/include" --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="$(basename $(<F)).d_raw" $(GEN_OPTS__FLAG) "$<"
"C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --idiv_support=idiv0 --tmu_support=tmu0 --vcu_support=vcrc -Ooff --opt_for_speed=2 --include_path="C:/Users/sedov/Desktop/T/FLASH MX29LV160DBTI-70G/emif1_ex1_16bit_asram" --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/common/include" --include_path="C:/Users/sedov/Desktop/Work/C2000Ware_5_00_00_00/device_support/f2838x/headers/include" --include_path="C:/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/include" --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="$(basename $(<F)).d_raw" $(GEN_OPTS__FLAG) "$<"
@echo 'Finished building: "$<"'
@echo ' '

View File

@ -59,8 +59,8 @@
#define TEST_PASS 0xABCDABCD
#define TEST_FAIL 0xDEADDEAD
#define ASRAM_CS3_START_ADDR 0x300000
#define ASRAM_CS3_SIZE 0x8000
#define ASRAM_CS2_START_ADDR 0x300000
#define ASRAM_CS2_SIZE 0x800
//
// Globals
@ -82,33 +82,47 @@ char mem_read_write(Uint32 start_addr, Uint32 mem_size) {
unsigned short mem_rds;
unsigned short mem_wds;
unsigned short* XMEM_ps;
unsigned short* XMEM_comm;
unsigned long i;
unsigned short* XMEM_comm;
unsigned short* a1;
unsigned short* a2;
unsigned short* a3;
a1=(unsigned short* )start_addr + (0x555*2);
a2=(unsigned short* )start_addr + (0x2AA*2);
a3=(unsigned short* )start_addr + (0x555*2);
unsigned long i,j;
// Write data
XMEM_comm=(unsigned short* )start_addr;
XMEM_ps = (unsigned short* )start_addr;
XMEM_comm = (unsigned short* )start_addr;
XMEM_ps++;
mem_wds = 0x0123;
for (i = 0; i < mem_size; i++) {
*(XMEM_comm + 0x555)=0xAA;
*(XMEM_comm + 0x2AA)=0x55;
*(XMEM_comm + 0xA0)=0x555;
DELAY_US(1);
*(a1)=0xAA;
DELAY_US(1);
*(a2)=0x55;
DELAY_US(1);
*(a3)=0xA0;
DELAY_US(1);
*(XMEM_ps) = mem_wds; // Çàïèñü ïî àäðåñó, çàòåì èíêðåìåíò
XMEM_ps+=2;
XMEM_ps++;
mem_wds += 0x1111;
}
// Verify memory
mem_wds = 0x0123;
XMEM_ps = (unsigned short* )start_addr;
for (i = 0; i < mem_size; i++) {
mem_rds = *(XMEM_ps); // ×òåíèå ïî àäðåñó, çàòåì èíêðåìåíò
XMEM_ps+=2;
XMEM_ps++;
if (mem_rds != mem_wds) {
return 1;
// return 1;
}
mem_wds += 0x1111;
}
return 0;
}
@ -159,7 +173,6 @@ void main(void)
//
EALLOW;
ClkCfgRegs.PERCLKDIVSEL.bit.EMIF1CLKDIV = 0x1;
ClkCfgRegs.PERCLKDIVSEL.bit.EPWMCLKDIV = 0x1;
EDIS;
EALLOW;
@ -209,18 +222,18 @@ void main(void)
setup_emif1_pinmux_async_16bit(0);
#define MEM_D_WIDTH 1 // 16Bit Memory Interface
#define TURN_AROUND_TIME 1 // Turn Around time
#define RD_SETUP_TIME 1 // Read Setup time
#define TURN_AROUND_TIME 3 // Turn Around time
#define RD_SETUP_TIME 3 // Read Setup time
#define RD_STROBE_TIME 15 // Read Strobe time
#define RD_HOLD_TIME 1 // Read Hold time
#define WR_SETUP_TIME 1 // Write Hold time
#define RD_HOLD_TIME 3 // Read Hold time
#define WR_SETUP_TIME 3 // Write Hold time
#define WR_STROBE_TIME 15 // Write Setup time
#define WR_HOLD_TIME 1 // Write Hold time
#define WR_HOLD_TIME 3 // Write Hold time
#define EXTEND_WAIT 0 // Disable Extended Wait
#define STROBE_SEL 0 // Disable Strobe Mode
// Îáúÿâëåíèå ñòðóêòóðû è åå èíèöèàëèçàöèÿ
struct ASYNC_CS3_CR_BITS cs3_cr_bits = {
struct ASYNC_CS2_CR_BITS cs3_cr_bits = {
.ASIZE = MEM_D_WIDTH,
.TA = TURN_AROUND_TIME,
.R_HOLD = RD_HOLD_TIME,
@ -239,7 +252,7 @@ Emif1Regs.ASYNC_CS3_CR.all = *(Uint32 *)&cs3_cr_bits;
//
//Check basic RD/WR access to CS2 space
//
ErrCount_local = mem_read_write(ASRAM_CS3_START_ADDR, ASRAM_CS3_SIZE);
ErrCount_local = mem_read_write(ASRAM_CS2_START_ADDR, ASRAM_CS2_SIZE);
ErrCount = ErrCount + ErrCount_local;

View File

@ -278,9 +278,12 @@ void setup_emif1_pinmux_async_16bit(Uint16 cpu_sel)
GPIO_SetupPinMux(28,cpu_sel,9);
GPIO_SetupPinMux(29,cpu_sel,9);
GPIO_SetupPinMux(36,cpu_sel,2);
GPIO_SetupPinMux(147, cpu_sel, 1); // Mux 1 äëÿ GPIO147
GPIO_SetupPinOptions(147, GPIO_OUTPUT, GPIO_PUSHPULL);
GPIO_WritePin(147, 1);
EALLOW;
GpioCtrlRegs.GPEPUD.bit.GPIO147 = 0; // Enable pullup on GPIO6
GpioDataRegs.GPESET.bit.GPIO147 = 1; // Load output latch
GpioCtrlRegs.GPEMUX2.bit.GPIO147 = 0; // GPIO6 = GPIO6
GpioCtrlRegs.GPEDIR.bit.GPIO147 = 1; // GPIO6 = output
EDIS;
}
//

View File

@ -1,55 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
<configuration XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
<instance XML_version="1.2" desc="Texas Instruments XDS2xx USB Debug Probe_0" href="connections/TIXDS2XXUSB_Connection.xml" id="Texas Instruments XDS2xx USB Debug Probe_0" xml="TIXDS2XXUSB_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS2xx USB Debug Probe_0">
<instance XML_version="1.2" href="drivers/tixds560icepick_c.xml" id="drivers" xml="tixds560icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560c28x.xml" id="drivers" xml="tixds560c28x.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560cla2.xml" id="drivers" xml="tixds560cla2.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560cs_child.xml" id="drivers" xml="tixds560cs_child.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560cs_dap.xml" id="drivers" xml="tixds560cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560cortexM.xml" id="drivers" xml="tixds560cortexM.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds560ajsm.xml" id="drivers" xml="tixds560ajsm.xml" xmlpath="drivers"/>
<platform XML_version="1.2" id="platform_0">
<instance XML_version="1.2" desc="TMS320F28388D_0" href="devices/f28388d.xml" id="TMS320F28388D_0" xml="f28388d.xml" xmlpath="devices"/>
<device HW_revision="1" XML_version="1.2" description="" id="TMS320F28388D_0" partnum="TMS320F28388D" simulation="no">
<device HW_revision="1" XML_version="1.2" description="" id="TMS320F28388D_0" partnum="TMS320F28388D">
<router HW_revision="1.0" XML_version="1.2" description="ICEPick_C router" id="IcePick_C_0" isa="ICEPICK_C">
<subpath id="Subpath_1">
<property Type="numericfield" Value="0x11" desc="Port Number_0" id="Port Number"/>
</subpath>
<subpath id="CM">
<property Type="numericfield" Value="0x12" desc="Port Number_1" id="Port Number"/>
</subpath>
</router>
</device>
</platform>
</connection>
</configuration>
</configurations>