From afa0b927386a8f71f5794d8263792e65cd9a2120 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Tue, 21 Aug 2018 09:14:40 +0300 Subject: update flash memory to R/W buffers. --- .../Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c index d75ce8663..3e3236a87 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c @@ -328,10 +328,10 @@ void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer) StubExtFlashWriteWordsResponse response = STUB_EXT_FLASH_WRITE_WORDS_RESPONSE__INIT; - response.address = 0;// alwayes send sddress 0 - response.has_address = true; + uint32_t Current_Start_address = ExtFlashWriteBuf(0,request->n_wordtwrite, request->wordtwrite);// alwayes send sddress 0 - uint32_t Address = ExtFlashWriteBuf(0,request->n_wordtwrite, request->wordtwrite);// alwayes send sddress 0 + response.address = Current_Start_address; + response.has_address = true; status_response(status,&response.status, &response.statusword ,&response.has_statusword); @@ -362,6 +362,9 @@ void Stub_ExtFlashReadWordsRequest(MessageContainer* requestContainer) response.readbytes = ExtFlashReadBuf(request->address,request->number_of_words); response.n_readbytes = request->number_of_words; + response.address = request->address; + response.has_address = true; + status_response(status,&response.status, &response.statusword ,&response.has_statusword); responseContainer = createContainer(MESSAGE_TYPE__StubExtFlashReadWordsResponse, requestContainer->token, true, &response, &stub_ext_flash_read_words_response__pack, &stub_ext_flash_read_words_response__get_packed_size); -- cgit v1.3.1 From 98493042a5dace2535dd4343c047eaf1bd784ae3 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Tue, 21 Aug 2018 09:15:19 +0300 Subject: update flash --- Software/Embedded_SW/.jxbrowser-data/Cache/data_0 | Bin 45056 -> 45056 bytes Software/Embedded_SW/.jxbrowser-data/Cache/data_1 | Bin 532480 -> 794624 bytes Software/Embedded_SW/.jxbrowser-data/Cache/data_2 | Bin 1056768 -> 2105344 bytes Software/Embedded_SW/.jxbrowser-data/Cache/data_3 | Bin 4202496 -> 8396800 bytes .../Embedded_SW/.jxbrowser-data/GPUCache/data_1 | Bin 270336 -> 270336 bytes Software/Embedded_SW/.jxbrowser-data/History | Bin 94208 -> 94208 bytes .../http_127.0.0.1.localstorage | 4 +- Software/Embedded_SW/.jxbrowser-data/Login Data | Bin 18432 -> 18432 bytes .../Embedded/Drivers/Flash_Memory/Flash_Memory.c | 41 +++++++++++++++++++-- .../Embedded/Drivers/Flash_Memory/Flash_Memory.h | 2 +- Software/Embedded_SW/Embedded/Main.c | 4 ++ .../Modules/Stubs_Handler/Stub_Cartridge.c | 10 +++++ .../Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c | 2 +- .../Stubs Collection/stubs/Ext_Flash_RW_Buf.cs | 6 +-- 14 files changed, 59 insertions(+), 10 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/.jxbrowser-data/Cache/data_0 b/Software/Embedded_SW/.jxbrowser-data/Cache/data_0 index fd7a261f3..4db352fb3 100644 Binary files a/Software/Embedded_SW/.jxbrowser-data/Cache/data_0 and b/Software/Embedded_SW/.jxbrowser-data/Cache/data_0 differ diff --git a/Software/Embedded_SW/.jxbrowser-data/Cache/data_1 b/Software/Embedded_SW/.jxbrowser-data/Cache/data_1 index f93dc7092..a46d23c87 100644 Binary files a/Software/Embedded_SW/.jxbrowser-data/Cache/data_1 and b/Software/Embedded_SW/.jxbrowser-data/Cache/data_1 differ diff --git a/Software/Embedded_SW/.jxbrowser-data/Cache/data_2 b/Software/Embedded_SW/.jxbrowser-data/Cache/data_2 index c9289a9fc..54bb2b79d 100644 Binary files a/Software/Embedded_SW/.jxbrowser-data/Cache/data_2 and b/Software/Embedded_SW/.jxbrowser-data/Cache/data_2 differ diff --git a/Software/Embedded_SW/.jxbrowser-data/Cache/data_3 b/Software/Embedded_SW/.jxbrowser-data/Cache/data_3 index a1a30e57f..3322af077 100644 Binary files a/Software/Embedded_SW/.jxbrowser-data/Cache/data_3 and b/Software/Embedded_SW/.jxbrowser-data/Cache/data_3 differ diff --git a/Software/Embedded_SW/.jxbrowser-data/GPUCache/data_1 b/Software/Embedded_SW/.jxbrowser-data/GPUCache/data_1 index a898e5e2b..4ffeb88cb 100644 Binary files a/Software/Embedded_SW/.jxbrowser-data/GPUCache/data_1 and b/Software/Embedded_SW/.jxbrowser-data/GPUCache/data_1 differ diff --git a/Software/Embedded_SW/.jxbrowser-data/History b/Software/Embedded_SW/.jxbrowser-data/History index b4191a552..af92dd0a9 100644 Binary files a/Software/Embedded_SW/.jxbrowser-data/History and b/Software/Embedded_SW/.jxbrowser-data/History differ diff --git a/Software/Embedded_SW/.jxbrowser-data/Local Storage - EXT/http_127.0.0.1.localstorage b/Software/Embedded_SW/.jxbrowser-data/Local Storage - EXT/http_127.0.0.1.localstorage index e606ba65a..32838ea86 100644 --- a/Software/Embedded_SW/.jxbrowser-data/Local Storage - EXT/http_127.0.0.1.localstorage +++ b/Software/Embedded_SW/.jxbrowser-data/Local Storage - EXT/http_127.0.0.1.localstorage @@ -1,4 +1,4 @@ -#Tue Jul 24 13:57:24 IDT 2018 +#Mon Aug 13 15:51:32 IDT 2018 viewsData-storage={"ti.sysbios.knl.Task.Basic"\:{"columnStates"\:[{"name"\:"address","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"label","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"priority","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"mode","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"fxn","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"arg0","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"arg1","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"stackSize","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"stackBase","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"curCoreId","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"affinity","checked"\:true,"hasFormat"\:false,"format"\:null}],"hasFormats"\:true},"ti.sysbios.knl.Task"\:{"defaultViewName"\:"CallStacks"},"ti.sysbios.family.arm.m3.Hwi.Basic"\:{"columnStates"\:[{"name"\:"address","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"halHwiHandle","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"label","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"type","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"intNum","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"priority","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"group","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"subPriority","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"fxn","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"arg","checked"\:true,"hasFormat"\:true,"format"\:"Hex"}],"hasFormats"\:true},"ti.sysbios.family.arm.m3.Hwi"\:{"defaultViewName"\:"Exception"},"ti.sysbios.knl.Task.Detailed"\:{"columnStates"\:[{"name"\:"address","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"label","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"priority","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"mode","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"fxn","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"arg0","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"arg1","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"stackPeak","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"stackSize","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"stackBase","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"curCoreId","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"affinity","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"blockedOn","checked"\:true,"hasFormat"\:false,"format"\:null}],"hasFormats"\:true},"ti.sysbios.family.arm.m3.Hwi.Detailed"\:{"columnStates"\:[{"name"\:"address","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"halHwiHandle","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"label","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"type","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"intNum","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"priority","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"group","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"subPriority","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"fxn","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"arg","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"irp","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"status","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"coreId","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"}],"hasFormats"\:true},"ti.sysbios.heaps.HeapMem.Basic"\:{"columnStates"\:[{"name"\:"address","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"label","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"buf","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"minBlockAlign","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"sectionName","checked"\:true,"hasFormat"\:false,"format"\:null}],"hasFormats"\:true},"ti.sysbios.knl.Event"\:{"defaultViewName"\:"Raw"},"ti.sysbios.knl.Event.Raw"\:{},"ti.catalog.arm.cortexm4.tiva.ce.Boot.Module"\:{"columnStates"\:[{"name"\:"address","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"configureClock","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"sysClockDivEnable","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"sysClockDiv","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"pwmClockDivEnable","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"pwmClockDiv","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"xtal","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"oscSrc","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"pllBypass","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"pllOutEnable","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"ioscDisable","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"moscDisable","checked"\:true,"hasFormat"\:false,"format"\:null}],"hasFormats"\:false},"ti.sysbios.knl.Swi.Basic"\:{"columnStates"\:[{"name"\:"address","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"label","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"state","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"priority","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"fxn","checked"\:true,"hasFormat"\:false,"format"\:null},{"name"\:"arg0","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"arg1","checked"\:true,"hasFormat"\:true,"format"\:"Hex"},{"name"\:"initTrigger","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"},{"name"\:"curTrigger","checked"\:true,"hasFormat"\:true,"format"\:"Decimal"}],"hasFormats"\:true},"xdc.runtime.System.XDCROOT"\:{"columnStates"\:[{"name"\:"entry","checked"\:true,"hasFormat"\:false,"format"\:null}],"hasFormats"\:false},"xdc.runtime.System"\:{"defaultViewName"\:"Raw"},"xdc.runtime.System.Raw"\:{},"ti.sysbios.family.arm.m3.Hwi.Raw"\:{}} rovSettings-storage={"exeMrus"\:["C\:/Tango/Software/Embedded_SW/Embedded/Debug/Embedded.out","C\:/Tango/Software/Embedded_SW/Embedded/debug_w_pmr/Embedded.out"]} -rovInit-storage={"progressInfo"\:{"min"\:0,"max"\:7,"step"\:1,"notifyCount"\:6,"average"\:6,"numLoads"\:18},"autoConnectChecked"\:false,"exe"\:"C\:/Tango/Software/Embedded_SW/Embedded/Debug/Embedded.out","commLink"\:"Debugger","autoConnect"\:false,"noExe"\:false,"showIntro"\:true} +rovInit-storage={"progressInfo"\:{"min"\:0,"max"\:7,"step"\:1,"notifyCount"\:0,"average"\:6,"numLoads"\:19},"autoConnectChecked"\:false,"exe"\:"C\:/Tango/Software/Embedded_SW/Embedded/Debug/Embedded.out","commLink"\:"Debugger","autoConnect"\:false,"noExe"\:false,"showIntro"\:true} diff --git a/Software/Embedded_SW/.jxbrowser-data/Login Data b/Software/Embedded_SW/.jxbrowser-data/Login Data index d9af96346..e844a2c9d 100644 Binary files a/Software/Embedded_SW/.jxbrowser-data/Login Data and b/Software/Embedded_SW/.jxbrowser-data/Login Data differ diff --git a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c index 9d2e048d4..3c79927ff 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c +++ b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c @@ -3,6 +3,11 @@ //see also https://github.com/yuvadm/tiva-c/blob/master/boards/dk-tm4c129x/drivers/mx66l51235f.c //On board Quad SPI 512Mb Flash + +//Macronixýþ þýMX66L51235FZ2I-10Gýþ +//Sector Size 4KB + + #include #include #include @@ -47,6 +52,12 @@ #define INS_PAGE_PROGRAM 0x02 #define INS_READ_DATA 0x03 +//-------------------- AVI: based on https://github.com/turingo/stm32ss/blob/master/src/stm32ss/bsp/sf.c +#define INS_BLOCK_ERASE (0xd8) +#define INS_CHIP_ERASE (0xc7) +#define INS_WRITE_DISABLE (0x04) +//------------------------- + #if defined(ewarm) #pragma data_alignment=1024 tDMAControlTable g_sDMAControlTable[6]; @@ -618,7 +629,7 @@ int Read_Ext_Flash_Device_ID() return 0; } -int Erase_Sector_before_writting_To_Ext_Flash(uint32_t ui32Address) +int Erase_Sector_before_writting_To_Ext_Flash(uint32_t ui32Address)// 4Kb every 100h is sector (0-0xFFF, 0x1000-0x1fff,..) { writeLine("Starting Erase Operations..."); @@ -630,6 +641,29 @@ int Erase_Sector_before_writting_To_Ext_Flash(uint32_t ui32Address) return 0; } +int Erase_Block(uint32_t ui32Address)// 32Kb or 64Kb ? +{ + writeLine("Starting Erase Block Operations..."); + + + SSILibSendEraseCommand(SSI3_BASE,ui32Address,INS_BLOCK_ERASE ); + + writeLine("Erase Block Completed..."); + + return 0; +} + +int Erase_Chip()// 32Kb or 64Kb ? +{ + writeLine("Starting Erase Block Operations..."); + + SSILibSendEraseCommand(SSI3_BASE,0,INS_CHIP_ERASE ); + + writeLine("Erase Block Completed..."); + + return 0; +} + int Write_Words_To_Ext_Flash(uint32_t ui32Address, uint32_t NumOfWords, uint32_t* TxBuf) { @@ -734,7 +768,8 @@ int Ext_Flash_Operation(uint32_t ui32Address,uint32_t Operation, uint32_t NumOf Display_RX_TX_Ext_Flash_Data(NumOfWords, pui32DataTx, NULL); // Erase the Sector before Program Operation... - //Erase_Sector_before_writting_To_Ext_Flash(ui32Address);//Erase all the sector not only from this address + Erase_Sector_before_writting_To_Ext_Flash(ui32Address);//Erase all the sector not only from this address + //Erase_Block(ui32Address);//Added by AVI for testing // Write NUM_SSI_DATA words to the External Flash Write_Words_To_Ext_Flash(ui32Address, NumOfWords, pui32DataTx); @@ -820,7 +855,7 @@ uint32_t ExtFlashWriteBuf(uint32_t ui32Address,uint32_t NumOfWords, uint32_t* p */ -uint32_t ExtFlashWriteBuf(uint32_t ui32Address,uint32_t NumOfWords, uint32_t* pui32DataTx)//ui32Address not in use +uint32_t ExtFlashWriteBuf(/*uint32_t ui32Address,*/uint32_t NumOfWords, uint32_t* pui32DataTx)//ui32Address not in use { uint32_t AddressCounter = 0; uint32_t i; diff --git a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.h b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.h index e0f9eb9f7..cca2cd848 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.h +++ b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.h @@ -4,7 +4,7 @@ int Ext_Flash_Operation(); int FlashFS_Init(); -uint32_t ExtFlashWriteBuf(uint32_t ui32Address,uint32_t NumOfWords, uint32_t* pui32DataTx); +uint32_t ExtFlashWriteBuf(/*uint32_t ui32Address,*/uint32_t NumOfWords, uint32_t* pui32DataTx); uint32_t* ExtFlashReadBuf(uint32_t ui32Address,uint32_t NumOfWords ); extern Flash_Union Flash_RW; diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index cb8755a68..c4f476859 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -193,6 +193,10 @@ int main(void) //Write_DAC_and_Input_Register(); +/* + Erase_Chip(); + SysCtlDelay(1000); + Erase_Block(0);*/ //----------------------------------------------------------- #ifndef EVALUATION_BOARD diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c index 49c7d0d3b..3e82a7062 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c @@ -29,6 +29,16 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) writeFloat(request->cartridgeid); + /* + int i; + for( i=0;i<8;i++) + { + Read_MidTank_Pressure_Sensor(i); + SysCtlDelay(1); + } + + */ + StubCartridgeReadResponse response = STUB_CARTRIDGE_READ_RESPONSE__INIT; response.cartridgeid = request->cartridgeid; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c index 3e3236a87..a336ffbc3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c @@ -328,7 +328,7 @@ void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer) StubExtFlashWriteWordsResponse response = STUB_EXT_FLASH_WRITE_WORDS_RESPONSE__INIT; - uint32_t Current_Start_address = ExtFlashWriteBuf(0,request->n_wordtwrite, request->wordtwrite);// alwayes send sddress 0 + uint32_t Current_Start_address = ExtFlashWriteBuf(/*0,*/request->n_wordtwrite, request->wordtwrite);// alwayes send sddress 0 response.address = Current_Start_address; response.has_address = true; diff --git a/Software/Stubs Collection/stubs/Ext_Flash_RW_Buf.cs b/Software/Stubs Collection/stubs/Ext_Flash_RW_Buf.cs index e10e2e32b..dc4b1059d 100644 --- a/Software/Stubs Collection/stubs/Ext_Flash_RW_Buf.cs +++ b/Software/Stubs Collection/stubs/Ext_Flash_RW_Buf.cs @@ -10,8 +10,8 @@ using System.Collections.Generic; using Tango.PMR.Stubs; using Tango.Stubs; -const Int32 No_Words = 1024;//1024 -uint Delta = 10000; //4000000000 +const Int32 No_Words = 128;//MaxFlashWords limited in datadef to 128 //1024 +uint Delta = 0; //4000000000 public void OnExecute(StubManager stubManager) { @@ -50,7 +50,7 @@ public void OnExecute(StubManager stubManager) // --------------------- Flash Read multibyte --------------------- StubExtFlashReadWordsRequest stubExtFlashReadWordsRequest = new StubExtFlashReadWordsRequest(); - stubExtFlashReadWordsRequest.Address = 0; + stubExtFlashReadWordsRequest.Address = response.Address; stubExtFlashReadWordsRequest.NumberOfWords = No_Words; // Number of words to read var response1 = stubManager.Run(stubExtFlashReadWordsRequest); -- cgit v1.3.1 From 79b7ce9cc16b8711572053216e512abca0f5e2b0 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Tue, 21 Aug 2018 10:18:45 +0300 Subject: Add Watchdog control for FPGA 1 + FPGA 3 FPGA Versions: F1: 16081814 F2: 16081826 F3: 19081834 --- Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h | 6 ++++++ .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 9 ++++++++- .../Embedded/Drivers/Flash_Memory/Flash_Memory.c | 8 ++++---- .../Embedded/Modules/Stubs_Handler/Stub_Cartridge.c | 18 +++++++++--------- 4 files changed, 27 insertions(+), 14 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h index dd817765c..1ecedf00c 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_Comm.h @@ -119,6 +119,9 @@ #define F1_DRYER_LOADARM_ROTENC_M (*((volatile short *)(FPGA1_BASE | 0x152))) //10bits Value of the Msb of the QEI register, 1bit Direction of movement, 5bits Reserved #define F1_DRYER_LOADARM_ROTENC_I (*((volatile short *)(FPGA1_BASE | 0x154))) //value of index counter +//WATCHDOG +#define F1_Watchdog_reg (*((volatile short *)(FPGA1_BASE | 0x160)))//Watchdog enable bit, watchdog value - F1_gpo_01 BIT2 DYEINGH_SSR10_CTRL HeadHeaterZ5 + //SSI #define F1_RSPARE_ROTENC_DATA_p_RX_lsb (*((volatile short *)(FPGA1_BASE | 0x180))) //The 16 Lsb bits of the shifted in data. #define F1_RSPARE_ROTENC_DATA_p_RX_msb (*((volatile short *)(FPGA1_BASE | 0x182))) //16 bit MSB if nessesary @@ -627,6 +630,9 @@ #define F3_RSPARE_ROTENC_msb (*((volatile short *)(FPGA3_BASE | 0x112))) //10bits Value of the Msb of the QEI register, 1bit Direction of movement, 5bits Reserved #define F3_RSPARE_ROTENC_index (*((volatile short *)(FPGA3_BASE | 0x114))) //value of index counter +//WATCHDOG +#define F3_Watchdog_reg (*((volatile short *)(FPGA3_BASE | 0x140)))//Watchdog enable bit, watchdog value - F3_GPO_01_bus BIT4 DYEINGH_SSR11_CTRL HeadHeaterZ6 + //SPI_MOTO_RLOADING_A1 #define F3_MOTO_SPARE1_1_A1_TX_00 (*((volatile short *)(FPGA3_BASE | 0x200))) //The second register to be shifted out of the spi. The msb bit of this register is shifted out first. #define F3_MOTO_SPARE1_1_A1_TX_01 (*((volatile short *)(FPGA3_BASE | 0x202))) //The first register to be shifted out of the spi. The msb bit of this register is shifted out first. diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index 4d10b6b7c..ed0411c36 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -376,13 +376,20 @@ uint32_t Control_WD(bool IsEnable, unsigned char SetTimer_Steps100mSec) // Contr */ { #ifndef EVALUATION_BOARD + + short WD_Enable = 0x4000 | SetTimer_Steps100mSec; + if (IsEnable == DISABLE) { + F1_Watchdog_reg = 0; F2_Watchdog_reg = 0; + F3_Watchdog_reg = 0; } else { - F2_Watchdog_reg = 0x4000 | SetTimer_Steps100mSec; // Enable the watchdog + F1_Watchdog_reg = WD_Enable; // Enable the watchdog F3_GPO_01_bus BIT4 DYEINGH_SSR11_CTRL HeadHeaterZ6 + F2_Watchdog_reg = WD_Enable; // Enable the watchdog F2_CTRL + reset dispensers motor drivers + F3_Watchdog_reg = WD_Enable; // Enable the watchdog F1_gpo_01 BIT2 DYEINGH_SSR10_CTRL HeadHeaterZ5 } #endif return OK; diff --git a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c index e69b1c20f..702ecafcc 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c +++ b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c @@ -630,23 +630,23 @@ int Erase_Sector_before_writting_To_Ext_Flash(uint32_t ui32Address)// 4Kb every int Erase_Block(uint32_t ui32Address)// 32Kb or 64Kb ? { - writeLine("Starting Erase Block Operations..."); + //writeLine("Starting Erase Block Operations..."); SSILibSendEraseCommand(SSI3_BASE,ui32Address,INS_BLOCK_ERASE ); - writeLine("Erase Block Completed..."); + //writeLine("Erase Block Completed..."); return 0; } int Erase_Chip()// 32Kb or 64Kb ? { - writeLine("Starting Erase Block Operations..."); + //writeLine("Starting Erase Block Operations..."); SSILibSendEraseCommand(SSI3_BASE,0,INS_CHIP_ERASE ); - writeLine("Erase Block Completed..."); + //writeLine("Erase Block Completed..."); return 0; } diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c index 3e82a7062..68b79edeb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c @@ -12,7 +12,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" +//#include "drivers/twine_graphicslib/graphics_adapter.h" #include "Stub_Status.h" @@ -25,9 +25,9 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) //request->cartridgeid - writeLine("cartridge Request: "); + //writeLine("cartridge Request: "); - writeFloat(request->cartridgeid); + //writeFloat(request->cartridgeid); /* int i; @@ -57,7 +57,7 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) response.has_cartridgeused = false; status_response(status,&response.status, &response.statusword ,&response.has_statusword); - +/* writeLine("Sending Response: "); writeFloat(response.cartridgeid); @@ -70,7 +70,7 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) writeString(", "); writeFloat(response.cartridgeused); writeString(", "); - +*/ Write_status_response(status); responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeReadResponse, requestContainer->token, true, &response, &stub_cartridge_read_response__pack, &stub_cartridge_read_response__get_packed_size); @@ -97,7 +97,7 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) //request->cartridgeversion //request->cartridgedata //request->cartridgeused - +/* writeLine("Cartridge Request: "); writeFloat(request->cartridgeid); @@ -109,7 +109,7 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) writeFloat(request->cartridgedata); writeString(", "); writeFloat(request->cartridgeused); - +*/ StubCartridgeWriteResponse response = STUB_CARTRIDGE_WRITE_RESPONSE__INIT; response.cartridgeid = request->cartridgeid; @@ -120,11 +120,11 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) // response.statusword = OK; // response.has_statusword = true; status_response(status,&response.status, &response.statusword ,&response.has_statusword); - +/* writeLine("Sending Response: "); writeFloat(response.cartridgeid); - writeString(", "); + writeString(", ");*/ // writeFloat(response.statusword); // WRITELINESTATUS; Write_status_response(status); -- cgit v1.3.1 From 2bb8ea274f0bf2a6e4f6424c623e92d6699846dc Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Wed, 22 Aug 2018 16:17:05 +0300 Subject: Change the Dispenser Pressure from MPascal -> Bar --- Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c index 185d4ac66..b035ff97b 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c @@ -69,6 +69,8 @@ float CalculateDispenserPressure (int DispenserId) //DispenserPressure[DispenserId] *=10000000; //uBar; //DispenserPressure[DispenserId] *=145.0377; //PSI; + DispenserPressure[DispenserId] *= 10; //MPascal -> Bar + return(DispenserPressure[DispenserId]); } -- cgit v1.3.1