Skip to content

Commit 0598ad0

Browse files
committed
[bsp][renesas] support code flash operations
1 parent 1d15380 commit 0598ad0

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

bsp/renesas/libraries/HAL_Drivers/drivers/drv_flash.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ bool calculate_block_num(int no, size_t addr, size_t size, void *erase_addr, voi
228228
level = rt_hw_interrupt_disable();
229229
R_FLASH_Reset(&g_flash_ctrl);
230230

231+
#if BSP_FEATURE_FLASH_HP_VERSION
231232
fal_block_iter(&_onchip_flash_hp0, &calculate_block_num, (void *)addr, (void *)size, &block_num);
233+
#else
234+
fal_block_iter(&_onchip_flash_lp, &calculate_block_num, (void *)addr, (void *)size, &block_num);
235+
#endif
232236

233237
/* Erase Block */
234238
#if BSP_FEATURE_FLASH_HP_VERSION
@@ -337,6 +341,11 @@ static int fal_flash_lp_erase(long offset, size_t size)
337341
return _flash_lp_erase(_onchip_flash_lp.addr + offset, size);
338342
}
339343

344+
void flash_callback(flash_callback_args_t * p_args)
345+
{
346+
347+
}
348+
340349
#endif
341350

342351
#endif
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2006-2023, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2022-07-20 Sherman the first version
9+
*/
10+
#ifndef _FAL_CFG_H_
11+
#define _FAL_CFG_H_
12+
13+
#include "hal_data.h"
14+
#include "rtconfig.h"
15+
16+
extern const struct fal_flash_dev _onchip_flash_lp;
17+
18+
#define FLASH_START_ADDRESS 0x00000000
19+
20+
/* flash device table */
21+
#define FAL_FLASH_DEV_TABLE \
22+
{ \
23+
&_onchip_flash_lp, \
24+
}
25+
/* ====================== Partition Configuration ========================== */
26+
#ifdef FAL_PART_HAS_TABLE_CFG
27+
/** partition table, The chip flash partition is defined in "\script\memory_regions.ld".
28+
* The partition start at 0x440 instead of 0 because OFS0, OFS1 and security MPU registers exist.
29+
* More details can be found in the RA2E2 Group User Manual: Hardware Figure 6.1.
30+
*
31+
* The table is used to define flash partition by struct fal_partition in fal_def.h */
32+
#define FAL_PART_TABLE \
33+
{ \
34+
{FAL_PART_MAGIC_WROD, "app", "onchip_flash_lp", 0x440, 0x0000fbc0, 0}, \
35+
}
36+
#endif /* FAL_PART_HAS_TABLE_CFG */
37+
#endif /* _FAL_CFG_H_ */
38+

bsp/renesas/ra2e2-ek/configuration.xml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@
240240
<symbolicName propertyId="p401.symbolic_name" value="IIC_SDA0"/>
241241
<symbolicName propertyId="p914.symbolic_name" value="LED2_GREEN"/>
242242
<pincfg active="true" name="EK-RA2E2.pincfg" selected="true" symbol="g_bsp_pin_cfg">
243-
<configSetting altId="i3c0.mode.enabled.free" configurationId="i3c0.mode"/>
244-
<configSetting altId="i3c0.scl0.p400" configurationId="i3c0.scl0"/>
245-
<configSetting altId="i3c0.sda0.p401" configurationId="i3c0.sda0"/>
243+
<configSetting altId="gpt6.mode.gtiocaorgtiocb.free" configurationId="gpt6.mode"/>
244+
<configSetting altId="gpt7.mode.gtiocaorgtiocb.free" configurationId="gpt7.mode"/>
245+
<configSetting altId="gpt9.mode.gtiocaorgtiocb.free" configurationId="gpt9.mode"/>
246246
<configSetting altId="jtag_fslash_swd.mode.swd.free" configurationId="jtag_fslash_swd.mode"/>
247247
<configSetting altId="jtag_fslash_swd.swclk.p300" configurationId="jtag_fslash_swd.swclk"/>
248248
<configSetting altId="jtag_fslash_swd.swdio.p108" configurationId="jtag_fslash_swd.swdio"/>
@@ -264,10 +264,6 @@
264264
<configSetting altId="p205.gpio_mode.gpio_mode_in" configurationId="p205.gpio_mode"/>
265265
<configSetting altId="p300.jtag_fslash_swd.swclk" configurationId="p300"/>
266266
<configSetting altId="p300.gpio_mode.gpio_mode_peripheral" configurationId="p300.gpio_mode"/>
267-
<configSetting altId="p400.i3c0.scl0" configurationId="p400"/>
268-
<configSetting altId="p400.gpio_mode.gpio_mode_peripheral" configurationId="p400.gpio_mode"/>
269-
<configSetting altId="p401.i3c0.sda0" configurationId="p401"/>
270-
<configSetting altId="p401.gpio_mode.gpio_mode_peripheral" configurationId="p401.gpio_mode"/>
271267
<configSetting altId="p914.output.low" configurationId="p914"/>
272268
<configSetting altId="p914.gpio_mode.gpio_mode_out.low" configurationId="p914.gpio_mode"/>
273269
<configSetting altId="sci9.mode.asynchronousuart.free" configurationId="sci9.mode"/>

0 commit comments

Comments
 (0)