Skip to content

Conversation

@zejiang0jason
Copy link
Contributor

Add workaround for MCUXSDK FTFX driver when FTFx_DRIVER_IS_FLASH_RESIDENT is enabled.
The SDK places the run command function in data section which is not executable when Zephyr configures memory permissions. Implement a RAM function to replace the FTFX driver's run command function

Fixes: #98560

Add workaround for MCUXSDK FTFX driver when FTFx_DRIVER_IS_FLASH_RESIDENT
is enabled.
The SDK places the run command function in data section which
is not executable when Zephyr configures memory permissions.
Implement a RAM function to replace the FTFX driver's run command function

Fixes: zephyrproject-rtos#98560

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
@sonarqubecloud
Copy link

@hakehuang
Copy link
Contributor

this fixes the E: ***** MPU FAULT ***** issue, but tests/drivers/flash/common still can not pass with below log.
the driver has access control need supported. but this can be another ticket.

*** Booting Zephyr OS build v4.3.0-rc2-97-g77030503b6d1 ***
Running TESTSUITE flash_driver
===================================================================
START - test_flash_copy
Test will run on device flash-controller@40020000

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/flash/common/src/main.c:480: test_flash_copy_inner: flash_flatten(flash_dev, page_info.start_offset, page_info.size) is non-zero

 FAIL - test_flash_copy in 0.022 seconds
===================================================================
START - test_flash_erase
Test will run on device flash-controller@40020000

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/flash/common/src/main.c:299: flash_driver_test_flash_erase: (rc not equal to 0)
Cannot write to flash
 FAIL - test_flash_erase in 0.019 seconds
===================================================================
START - test_flash_fill
Test will run on device flash-controller@40020000

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/flash/common/src/main.c:228: flash_driver_test_flash_fill: (rc not equal to 0)
Flash memory not properly erased
 FAIL - test_flash_fill in 0.020 seconds
===================================================================
START - test_flash_flatten
Test will run on device flash-controller@40020000

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/flash/common/src/main.c:267: flash_driver_test_flash_flatten: (rc not equal to 0)
Flash not leveled not properly erased
 FAIL - test_flash_flatten in 0.021 seconds
===================================================================
START - test_flash_page_layout
Test will run on device flash-controller@40020000
start_offset=0xe4000	size=8192	index=114
page_count=128
 PASS - test_flash_page_layout in 0.010 seconds
===================================================================
START - test_flash_write_read_over_the_packet_limit
Test will run on device flash-controller@40020000
Given bus controller does not have 'packet_data_limit' property
 SKIP - test_flash_write_read_over_the_packet_limit in 0.011 seconds
===================================================================
START - test_get_size
Test will run on device flash-controller@40020000
 SKIP - test_get_size in 0.005 seconds
===================================================================
START - test_read_unaligned_address
Test will run on device flash-controller@40020000

    Assertion failed at WEST_TOPDIR/zephyr/tests/drivers/flash/common/src/main.c:174: flash_driver_test_read_unaligned_address: (rc not equal to 0)
Flash memory not properly erased
 FAIL - test_read_unaligned_address in 0.021 seconds
===================================================================
START - test_supply_gpios_control
Test will run on device flash-controller@40020000
 SKIP - test_supply_gpios_control in 0.005 seconds
===================================================================
TESTSUITE flash_driver failed.

------ TESTSUITE SUMMARY START ------

SUITE FAIL -  16.67% [flash_driver]: pass = 1, fail = 5, skip = 3, total = 9 duration = 0.134 seconds
 - FAIL - [flash_driver.test_flash_copy] duration = 0.022 seconds
 - FAIL - [flash_driver.test_flash_erase] duration = 0.019 seconds
 - FAIL - [flash_driver.test_flash_fill] duration = 0.020 seconds
 - FAIL - [flash_driver.test_flash_flatten] duration = 0.021 seconds
 - PASS - [flash_driver.test_flash_page_layout] duration = 0.010 seconds
 - SKIP - [flash_driver.test_flash_write_read_over_the_packet_limit] duration = 0.011 seconds
 - SKIP - [flash_driver.test_get_size] duration = 0.005 seconds
 - FAIL - [flash_driver.test_read_unaligned_address] duration = 0.021 seconds
 - SKIP - [flash_driver.test_supply_gpios_control] duration = 0.005 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
RunID: 5a00359fa3ad18ec02a3e3a959ededb9
PROJECT EXECUTION FAILED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: tests/drivers/flash/common: kinetis with arm mpu : failed: Testsuite failed

5 participants