This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM2434:闪存与 AM2434集成

Guru**** 2394125 points
Other Parts Discussed in Thread: AM2434

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1243101/am2434-flash-integration-with-am2434

器件型号:AM2434

大家好、

我拥有 AM2434定制电路板并将其与支持1GB 四通道闪存的 SFDP 相连。

我已经成功实现了"ospi_flash_diag_am2434"并获得了所有数据、然后在启用 DMA 的情况下使用"ospi_flash_dma_am2434"进行尝试、禁用 PHY 且 D0-D3数据引脚。

首先、我已经按照以下图像成功实施了1S-1S-1S 协议

然后我尝试了1S-1S-2S 和4S-4S-4S、但它卡在无限循环中。 然后,在这之后,我再次尝试与1S-1S-1S ,该协议也没有工作,得到以下错误。

[MAIN_Cortex_R5_0_0] [OSPI] DMA low latency example started...
ERROR: App_OspiFlashDmaCompareBuffers:434: OSPI read data mismatch at index 1 !!!
OSPI Write 32 bytes in 44216 ns
OSPI Read 32 bytes in 5805 ns
OSPI Read 32 bytes in 0 ns
OSPI Read 32 bytes in 0 ns
OSPI Read 32 bytes in 0 ns
OSPI Read 32 bytes in 0 ns
OSPI Read 32 bytes in 0 ns
OSPI Read 32 bytes in 0 ns
OSPI Read 32 bytes in 0 ns
OSPI Read 32 bytes in 0 ns
OSPI Read 32 bytes in 0 ns
Average time for OSPI Read 32 bytes in 580 ns
Some tests have failed !!!

之前也发生了同样的事情,当时我确实重新启动并处理了诊断和 DMA 代码,与之一起使用1S-1S-1S。 但现在它不起作用

--

谢谢。此致、

D·帕特尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好、Divyesh。

    可能支持的 SFDP 表与预期的表不同。

    请试用此常见问题解答- https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1230063/faq-mcu-plus-sdk-am243x-faq-how-to-debug-develop-migrate-the-flash-driver-for-custom-flash-on-non-ti-evm-ospi-xspi

    随后将介绍支持的所有模式以及常见的更改。 此外、如果您也可以共享闪存供应商的数据表、则支持将变得更轻松。

    此致、
    Aakash

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Akash:

    感谢您的答复。

    是的、我提到过。

    PFA 数据表和诊断数据。

    e2e.ti.com/.../1GB_5F00_MT25QL01GBBB.pdf

    [MAIN_Cortex_R5_0_0] [OSPI Flash Diagnostic Test] Starting ...
    [OSPI Flash Diagnostic Test] Flash Manufacturer ID : 0x20
    [OSPI Flash Diagnostic Test] Flash Device ID       : 0xBA21
    [OSPI Flash Diagnostic Test] Executing Flash Erase on first block...
    [OSPI Flash Diagnostic Test] Done !!!
    [OSPI Flash Diagnostic Test] Performing Write-Read Test...
    [OSPI Flash Diagnostic Test] Write-Read Test Passed!
    [QSPI Flash Diagnostic Test] SFDP Information : 
    ================================================
                          SFDP                      
    ================================================
    SFDP Major Revision                       : 0x1
    SFDP Minor Revision                       : 0x6
    Number of Parameter Headers in this Table : 2
    
    Types of Additional Parameter Tables in this flash
    ---------------------------------------------------
    4 BYTE ADDRESSING MODE INSTRUCTIONS TABLE
    JSON Data for the flash :
    
    {
    
    	"flashSize": 134217728,
    	"flashPageSize": 256,
    	"flashManfId": "0x20",
    	"flashDeviceId": "0xBA21",
    	"flashBlockSize": 65536,
    	"flashSectorSize": 4096,
    	"cmdBlockErase3B": "0xD8",
    	"cmdBlockErase4B": "0xDC",
    	"cmdSectorErase3B": "0x20",
    	"cmdSectorErase4B": "0x21",
    	"protos": {
    		"p111": {
    			"isDtr": false,
    			"cmdRd": "0x03",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 0,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 0,
    			"enableType": "0",
    			"enableSeq": "0x00",
    			"dummyCfg": null,
    			"protoCfg": null,
    			"strDtrCfg": null
    		},
    		"p112": {
    			"isDtr": false,
    			"cmdRd": "0x3C",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 1,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 7,
    			"enableType": "0",
    			"enableSeq": "0x00",
    			"dummyCfg": null,
    			"protoCfg": null,
    			"strDtrCfg": null
    		},
    		"p114": {
    			"isDtr": false,
    			"cmdRd": "0x6C",
    			"cmdWr": "0x34",
    			"modeClksCmd": 0,
    			"modeClksRd": 1,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 7,
    			"enableType": "0",
    			"enableSeq": "0x00",
    			"dummyCfg": null,
    			"protoCfg": null,
    			"strDtrCfg": null
    		},
    		"p118": {
    			"isDtr": false,
    			"cmdRd": "0x7C",
    			"cmdWr": "0x84",
    			"modeClksCmd": 0,
    			"modeClksRd": 0,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 0,
    			"enableType": "255",
    			"enableSeq": "0x00",
    			"dummyCfg": null,
    			"protoCfg": null,
    			"strDtrCfg": null
    		},
    		"p444s": {
    			"isDtr": false,
    			"cmdRd": "0xEB",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 1,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 9,
    			"enableType": "0",
    			"enableSeq": "0x14",
    			"dummyCfg": {
    				"isAddrReg": false,
    				"cmdRegRd":"0x00",
    				"cmdRegWr":"0x00",
    				"cfgReg":"0x00000000",
    				"shift":0,
    				"mask":"0x00",
    				"bitP":0
    			},
    			"protoCfg": {
    				"isAddrReg": false,
    				"cmdRegRd": "0x00",
    				"cmdRegWr": "0x00",
    				"cfgReg": "0x00000000",
    				"shift": 0,
    				"mask": "0x00",
    				"bitP": 0
    			},
    			"strDtrCfg": {
    				"isAddrReg": false,
    				"cmdRegRd": "0x00",
    				"cmdRegWr": "0x00",
    				"cfgReg": "0x00000000",
    				"shift": 0,
    				"mask": "0x00",
    				"bitP": 0
    			}
    		},
    		"p444d": {
    			"isDtr": false,
    			"cmdRd": "0xEB",
    			"cmdWr": "0x02",
    			"modeClksCmd": 0,
    			"modeClksRd": 1,
    			"dummyClksCmd": 0,
    			"dummyClksRd": 9,
    			"enableType": "0",
    			"enableSeq": "0x14",
    			"dummyCfg": {
    				"isAddrReg": false,
    				"cmdRegRd":"0x00",
    				"cmdRegWr":"0x00",
    				"cfgReg":"0x00000000",
    				"shift":0,
    				"mask":"0x00",
    				"bitP":0
    			},
    			"protoCfg": {
    				"isAddrReg": false,
    				"cmdRegRd": "0x00",
    				"cmdRegWr": "0x00",
    				"cfgReg": "0x00000000",
    				"shift": 0,
    				"mask": "0x00",
    				"bitP": 0
    			},
    			"strDtrCfg": {
    				"isAddrReg": false,
    				"cmdRegRd": "0x00",
    				"cmdRegWr": "0x00",
    				"cfgReg": "0x00000000",
    				"shift": 0,
    				"mask": "0x00",
    				"bitP": 0
    			}
    		},
    		"p888s": null,
    		"p888d": null,
    		"pCustom": { 
    			"fxn": null
    		}
    	},
    	"addrByteSupport": "1",
    	"fourByteAddrEnSeq": "0x36",
    	"cmdExtType": "NONE",
    	"resetType": "0x3D",
    	"deviceBusyType": "0",
    	"cmdWren": "0x06",
    	"cmdRdsr": "0x05",
    	"srWip":  0,
    	"srWel":  0,
    	"cmdChipErase": "0xC7",
    	"rdIdSettings": {
    		"cmd": "0x9F",
    		"numBytes": 5,
    		"dummy4": 0,
    		"dummy8": 0
    	},
    	"xspiWipRdCmd": "0x00",
    	"xspiWipReg": "0x00000000",
    	"xspiWipBit": 0,
    	"flashDeviceBusyTimeout": 128000000,
    	"flashPageProgTimeout": 120
    }
    
    All tests have passed!!
    

    --

    谢谢。此致、

    D·帕特尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Divyesh:

    您是否可以共享相同的 syscfg?

    此致、
    Aakash

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Akash:

    PFA 详细信息。

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "AM243x_ALV_beta" --package "ALV" --part "ALV" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM243x@08.06.00"
     * @versions {"tool":"1.14.0+2667"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const flash      = scripting.addModule("/board/flash/flash", {}, false);
    const flash1     = flash.addInstance();
    const udma       = scripting.addModule("/drivers/udma/udma", {}, false);
    const udma1      = udma.addInstance();
    const clock      = scripting.addModule("/kernel/dpl/clock");
    const debug_log  = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7  = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71 = mpu_armv7.addInstance();
    const mpu_armv72 = mpu_armv7.addInstance();
    const mpu_armv73 = mpu_armv7.addInstance();
    const mpu_armv74 = mpu_armv7.addInstance();
    const mpu_armv75 = mpu_armv7.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    flash1.$name                           = "CONFIG_FLASH0";
    flash1.flashSize                       = 134217728;
    flash1.flashManfId                     = "0x20";
    flash1.flashDeviceId                   = "0xBA21";
    flash1.flashBlockSize                  = 65536;
    flash1.cmdBlockErase3B                 = "0xD8";
    flash1.cmdSectorErase3B                = "0x20";
    flash1.dummyClksCmd                    = 0;
    flash1.dummy_isAddrReg                 = false;
    flash1.device                          = "CUSTOM_FLASH";
    flash1.fname                           = "MT25G01";
    flash1.proto_isAddrReg                 = false;
    flash1.strDtr_isAddrReg                = false;
    flash1.cmdWr                           = "0x02";
    flash1.cmdRd                           = "0x03";
    flash1.dummyClksRd                     = 0;
    flash1.protocol                        = "1s_1s_1s";
    flash1.peripheralDriver.$name          = "CONFIG_OSPI0";
    flash1.peripheralDriver.dmaEnable      = true;
    flash1.peripheralDriver.baudRateDiv    = 2;
    flash1.peripheralDriver.OSPI.DQS.$used = false;
    flash1.peripheralDriver.OSPI.D7.rx     = false;
    flash1.peripheralDriver.OSPI.D7.$used  = false;
    flash1.peripheralDriver.OSPI.D6.rx     = false;
    flash1.peripheralDriver.OSPI.D6.$used  = false;
    flash1.peripheralDriver.OSPI.D5.rx     = false;
    flash1.peripheralDriver.OSPI.D5.$used  = false;
    flash1.peripheralDriver.OSPI.D4.rx     = false;
    flash1.peripheralDriver.OSPI.D4.$used  = false;
    
    udma1.$name                        = "CONFIG_UDMA0";
    flash1.peripheralDriver.udmaDriver = udma1;
    udma1.udmaBlkCopyChannel.create(1);
    udma1.udmaBlkCopyChannel[0].$name  = "CONFIG_UDMA_BLKCOPY_CH0";
    
    debug_log.enableUartLog        = true;
    debug_log.uartLog.$name        = "CONFIG_UART_LOG";
    debug_log.uartLog.UART.$assign = "USART0";
    
    mpu_armv71.$name             = "CONFIG_MPU_REGION0";
    mpu_armv71.size              = 31;
    mpu_armv71.attributes        = "Device";
    mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv71.allowExecute      = false;
    
    mpu_armv72.$name             = "CONFIG_MPU_REGION1";
    mpu_armv72.size              = 15;
    mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv73.$name             = "CONFIG_MPU_REGION2";
    mpu_armv73.baseAddr          = 0x41010000;
    mpu_armv73.size              = 15;
    mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv74.$name             = "CONFIG_MPU_REGION3";
    mpu_armv74.baseAddr          = 0x70000000;
    mpu_armv74.size              = 21;
    mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv75.$name    = "CONFIG_MPU_REGION5";
    mpu_armv75.baseAddr = 0x80000000;
    mpu_armv75.size     = 31;
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    flash1.peripheralDriver.OSPI.$suggestSolution      = "OSPI0";
    flash1.peripheralDriver.OSPI.CLK.$suggestSolution  = "ball.N20";
    flash1.peripheralDriver.OSPI.CSn0.$suggestSolution = "ball.L19";
    flash1.peripheralDriver.OSPI.D3.$suggestSolution   = "ball.M21";
    flash1.peripheralDriver.OSPI.D2.$suggestSolution   = "ball.M20";
    flash1.peripheralDriver.OSPI.D1.$suggestSolution   = "ball.M18";
    flash1.peripheralDriver.OSPI.D0.$suggestSolution   = "ball.M19";
    debug_log.uartLog.UART.RXD.$suggestSolution        = "ball.D15";
    debug_log.uartLog.UART.TXD.$suggestSolution        = "ball.C16";
    

    --

    谢谢。此致、

    D·帕特尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Divyesh:

    您可以尝试降低控制器的速度吗? 我认为、如果在没有 PHY 的1-1-1模式下工作、50MHz 也适合控制器。

    此致、
    Aakash

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Akash:

    您能降低控制器的速度吗? 我认为、如果在没有 PHY 的1-1-1模式下工作、50MHz 也适合控制器。

    我尝试了50MHz、它适用于1S-1S-1S、但不适用于具有1字节 DMA 数据的1S-1S-2S。

    [MAIN_Cortex_R5_0_0] [OSPI] DMA low latency example started...
    ERROR: App_OspiFlashDmaCompareBuffers:435: OSPI read data mismatch at index 0 !!!
    OSPI Write 1 bytes in 24693 ns
    OSPI Read 1 bytes in 7395 ns
    OSPI Read 1 bytes in 0 ns
    OSPI Read 1 bytes in 0 ns
    OSPI Read 1 bytes in 0 ns
    OSPI Read 1 bytes in 0 ns
    OSPI Read 1 bytes in 0 ns
    OSPI Read 1 bytes in 0 ns
    OSPI Read 1 bytes in 0 ns
    OSPI Read 1 bytes in 0 ns
    OSPI Read 1 bytes in 0 ns
    Average time for OSPI Read 1 bytes in 738 ns
    Some tests have failed !!!
    

    --

    谢谢。此致、

    D·帕特尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Divyesh:

    您是否可以共享您的不工作的 syscfg,或者仅共享1-1-1和1-1-2之间所做的更改?

    此致、
    Aakash

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Akash:

    好的、可以。

    工作1S-1S-1S  

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "AM243x_ALV_beta" --package "ALV" --part "ALV" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM243x@08.06.00"
     * @versions {"tool":"1.14.0+2667"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const flash      = scripting.addModule("/board/flash/flash", {}, false);
    const flash1     = flash.addInstance();
    const udma       = scripting.addModule("/drivers/udma/udma", {}, false);
    const udma1      = udma.addInstance();
    const clock      = scripting.addModule("/kernel/dpl/clock");
    const debug_log  = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7  = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71 = mpu_armv7.addInstance();
    const mpu_armv72 = mpu_armv7.addInstance();
    const mpu_armv73 = mpu_armv7.addInstance();
    const mpu_armv74 = mpu_armv7.addInstance();
    const mpu_armv75 = mpu_armv7.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    flash1.$name                           = "CONFIG_FLASH0";
    flash1.flashSize                       = 134217728;
    flash1.flashManfId                     = "0x20";
    flash1.flashDeviceId                   = "0xBA21";
    flash1.flashBlockSize                  = 65536;
    flash1.cmdBlockErase3B                 = "0xD8";
    flash1.cmdSectorErase3B                = "0x20";
    flash1.dummyClksCmd                    = 0;
    flash1.dummy_isAddrReg                 = false;
    flash1.device                          = "CUSTOM_FLASH";
    flash1.fname                           = "MT25G01";
    flash1.strDtr_isAddrReg                = false;
    flash1.protocol                        = "1s_1s_1s";
    flash1.cmdRd                           = "0x03";
    flash1.cmdWr                           = "0x02";
    flash1.dummyClksRd                     = 0;
    flash1.peripheralDriver.$name          = "CONFIG_OSPI0";
    flash1.peripheralDriver.dmaEnable      = true;
    flash1.peripheralDriver.inputClkFreq   = 50000000;
    flash1.peripheralDriver.OSPI.DQS.$used = false;
    flash1.peripheralDriver.OSPI.D7.rx     = false;
    flash1.peripheralDriver.OSPI.D7.$used  = false;
    flash1.peripheralDriver.OSPI.D6.rx     = false;
    flash1.peripheralDriver.OSPI.D6.$used  = false;
    flash1.peripheralDriver.OSPI.D5.rx     = false;
    flash1.peripheralDriver.OSPI.D5.$used  = false;
    flash1.peripheralDriver.OSPI.D4.rx     = false;
    flash1.peripheralDriver.OSPI.D4.$used  = false;
    
    udma1.$name                        = "CONFIG_UDMA0";
    flash1.peripheralDriver.udmaDriver = udma1;
    udma1.udmaBlkCopyChannel.create(1);
    udma1.udmaBlkCopyChannel[0].$name  = "CONFIG_UDMA_BLKCOPY_CH0";
    
    debug_log.enableUartLog        = true;
    debug_log.uartLog.$name        = "CONFIG_UART_LOG";
    debug_log.uartLog.UART.$assign = "USART0";
    
    mpu_armv71.$name             = "CONFIG_MPU_REGION0";
    mpu_armv71.size              = 31;
    mpu_armv71.attributes        = "Device";
    mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv71.allowExecute      = false;
    
    mpu_armv72.$name             = "CONFIG_MPU_REGION1";
    mpu_armv72.size              = 15;
    mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv73.$name             = "CONFIG_MPU_REGION2";
    mpu_armv73.baseAddr          = 0x41010000;
    mpu_armv73.size              = 15;
    mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv74.$name             = "CONFIG_MPU_REGION3";
    mpu_armv74.baseAddr          = 0x70000000;
    mpu_armv74.size              = 21;
    mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv75.$name    = "CONFIG_MPU_REGION5";
    mpu_armv75.baseAddr = 0x80000000;
    mpu_armv75.size     = 31;
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    flash1.peripheralDriver.OSPI.$suggestSolution      = "OSPI0";
    flash1.peripheralDriver.OSPI.CLK.$suggestSolution  = "ball.N20";
    flash1.peripheralDriver.OSPI.CSn0.$suggestSolution = "ball.L19";
    flash1.peripheralDriver.OSPI.D3.$suggestSolution   = "ball.M21";
    flash1.peripheralDriver.OSPI.D2.$suggestSolution   = "ball.M20";
    flash1.peripheralDriver.OSPI.D1.$suggestSolution   = "ball.M18";
    flash1.peripheralDriver.OSPI.D0.$suggestSolution   = "ball.M19";
    debug_log.uartLog.UART.RXD.$suggestSolution        = "ball.D15";
    debug_log.uartLog.UART.TXD.$suggestSolution        = "ball.C16";
    

    1S-1S-4S 不工作

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "AM243x_ALV_beta" --package "ALV" --part "ALV" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM243x@08.06.00"
     * @versions {"tool":"1.14.0+2667"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const flash      = scripting.addModule("/board/flash/flash", {}, false);
    const flash1     = flash.addInstance();
    const udma       = scripting.addModule("/drivers/udma/udma", {}, false);
    const udma1      = udma.addInstance();
    const clock      = scripting.addModule("/kernel/dpl/clock");
    const debug_log  = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7  = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71 = mpu_armv7.addInstance();
    const mpu_armv72 = mpu_armv7.addInstance();
    const mpu_armv73 = mpu_armv7.addInstance();
    const mpu_armv74 = mpu_armv7.addInstance();
    const mpu_armv75 = mpu_armv7.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    flash1.$name                           = "CONFIG_FLASH0";
    flash1.flashSize                       = 134217728;
    flash1.flashManfId                     = "0x20";
    flash1.flashDeviceId                   = "0xBA21";
    flash1.flashBlockSize                  = 65536;
    flash1.cmdBlockErase3B                 = "0xD8";
    flash1.cmdSectorErase3B                = "0x20";
    flash1.dummyClksCmd                    = 0;
    flash1.dummy_isAddrReg                 = false;
    flash1.device                          = "CUSTOM_FLASH";
    flash1.fname                           = "MT25G01";
    flash1.strDtr_isAddrReg                = false;
    flash1.protocol                        = "1s_1s_4s";
    flash1.cmdRd                           = "0x6C";
    flash1.cmdWr                           = "0x34";
    flash1.modeClksRd                      = 1;
    flash1.dummyClksRd                     = 7;
    flash1.peripheralDriver.$name          = "CONFIG_OSPI0";
    flash1.peripheralDriver.dmaEnable      = true;
    flash1.peripheralDriver.inputClkFreq   = 50000000;
    flash1.peripheralDriver.OSPI.DQS.$used = false;
    flash1.peripheralDriver.OSPI.D7.rx     = false;
    flash1.peripheralDriver.OSPI.D7.$used  = false;
    flash1.peripheralDriver.OSPI.D6.rx     = false;
    flash1.peripheralDriver.OSPI.D6.$used  = false;
    flash1.peripheralDriver.OSPI.D5.rx     = false;
    flash1.peripheralDriver.OSPI.D5.$used  = false;
    flash1.peripheralDriver.OSPI.D4.rx     = false;
    flash1.peripheralDriver.OSPI.D4.$used  = false;
    
    udma1.$name                        = "CONFIG_UDMA0";
    flash1.peripheralDriver.udmaDriver = udma1;
    udma1.udmaBlkCopyChannel.create(1);
    udma1.udmaBlkCopyChannel[0].$name  = "CONFIG_UDMA_BLKCOPY_CH0";
    
    debug_log.enableUartLog        = true;
    debug_log.uartLog.$name        = "CONFIG_UART_LOG";
    debug_log.uartLog.UART.$assign = "USART0";
    
    mpu_armv71.$name             = "CONFIG_MPU_REGION0";
    mpu_armv71.size              = 31;
    mpu_armv71.attributes        = "Device";
    mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
    mpu_armv71.allowExecute      = false;
    
    mpu_armv72.$name             = "CONFIG_MPU_REGION1";
    mpu_armv72.size              = 15;
    mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv73.$name             = "CONFIG_MPU_REGION2";
    mpu_armv73.baseAddr          = 0x41010000;
    mpu_armv73.size              = 15;
    mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv74.$name             = "CONFIG_MPU_REGION3";
    mpu_armv74.baseAddr          = 0x70000000;
    mpu_armv74.size              = 21;
    mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
    
    mpu_armv75.$name    = "CONFIG_MPU_REGION5";
    mpu_armv75.baseAddr = 0x80000000;
    mpu_armv75.size     = 31;
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    flash1.peripheralDriver.OSPI.$suggestSolution      = "OSPI0";
    flash1.peripheralDriver.OSPI.CLK.$suggestSolution  = "ball.N20";
    flash1.peripheralDriver.OSPI.CSn0.$suggestSolution = "ball.L19";
    flash1.peripheralDriver.OSPI.D3.$suggestSolution   = "ball.M21";
    flash1.peripheralDriver.OSPI.D2.$suggestSolution   = "ball.M20";
    flash1.peripheralDriver.OSPI.D1.$suggestSolution   = "ball.M18";
    flash1.peripheralDriver.OSPI.D0.$suggestSolution   = "ball.M19";
    debug_log.uartLog.UART.RXD.$suggestSolution        = "ball.D15";
    debug_log.uartLog.UART.TXD.$suggestSolution        = "ball.C16";
    

    --

    谢谢。此致、

    D·帕特尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Divyesh:

    您是否真的关注常见问题? 明确提到的一切都不是宗教遵循的。

    您的配置存在的问题列表--

    1.您已将4条数据线路上的"Program"命令更改为"Fast Program"。 我不确定这是否得到支持。

    您应该使用的是 4字节页程序(12h)  这仅因为您启用了4字节寻址。


    2.定义了一些 quirks 函数。 这是不对的。 您应该将其保留为 NULL。 请查看常见问题解答。


    3.协议配置设置为已启用,并且根本未配置虚拟周期。

    您应该写入易失性配置寄存器以配置虚拟配置。

    0x71无论如何都不是有效的写入命令。


    4.启用4字节寻址不正确--


    5.您还应该进行此配置-

    由于这是非常定制的实现方式、您需要修改驱动程序/闪存打开函数、即  flash_norOspiOpen 或  Flash_setQeBit (闪存_设置 QeBit)  要呼叫 状态= flash_norOspiCmdWrite (config、0x35、OSPI_CMD_INVALID_ADDR、0、NULL、 0);

    因此器件进入四路模式。

    同样、我强烈建议遵循常见问题解答。

    此致、
    Aakash

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Aakash:

    实际上、通过遵循常见问题解答中存在的任何可配置术语、我尝试仅对其进行编辑。 我没有得到其余的术语及其使用和资源来理解。

     

    但在你最后一条消息 ,我得到了想法,并尝试相应地实施它。

    非常感谢您的支持。

    --

    谢谢。此致、

    D·帕特尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Divyesh:

    这里提到了一些奇怪的功能-  

    许多配置都是特定于供应商的、尽管硬件可能支持、但软件可能不支持开箱即用、需要进行大量更改。

    但是、我们尽量将这些修改抽象化。

    如果您有任何常见问题解答、请提供相关评论(在个人消息中提供、以便对其他开发人员也有所帮助)。

    此致、
    Aakash