Skip to content

Commit eb4e4e0

Browse files
authored
Merge pull request #4191 from thread-liu/main
[ST32MP1] add modifier __no_init for IAR
2 parents d22fde6 + 534239b commit eb4e4e0

File tree

8 files changed

+57
-58
lines changed

8 files changed

+57
-58
lines changed

bsp/stm32/stm32mp157a-st-ev1/board/Kconfig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ menu "Onboard Peripheral Drivers"
6060
select RT_USING_SDIO
6161
select RT_USING_DFS
6262
select RT_USING_DFS_ELMFAT
63-
select BSP_USING_PMIC
6463
if BSP_USING_SDMMC
65-
menuconfig BSP_USING_SD_CARD
64+
menuconfig BSP_USING_SDCARD
6665
bool "Enable sd card"
66+
select BSP_USING_PMIC
6767
default n
68-
if BSP_USING_SD_CARD
69-
config SD_USING_DFS
68+
if BSP_USING_SDCARD
69+
config BSP_USING_SDCARD_FS
7070
bool "sd card fatfs"
7171
default y
7272
endif
@@ -75,7 +75,7 @@ menu "Onboard Peripheral Drivers"
7575
bool "Enable eMMC (32 Gbits)"
7676
default n
7777
if BSP_USING_EMMC
78-
config EMMC_USING_DFS
78+
config BSP_USING_EMMC_FS
7979
bool "emmc card fatfs"
8080
default y
8181
endif
@@ -86,7 +86,7 @@ menu "Onboard Peripheral Drivers"
8686
select RT_USING_AUDIO
8787
select BSP_USING_PMIC
8888
select BSP_USING_SDMMC
89-
select BSP_USING_SD_CARD
89+
select BSP_USING_SDCARD
9090
select SD_USING_DFS
9191
select BSP_USING_I2C
9292
select BSP_USING_I2C2
@@ -96,6 +96,8 @@ menu "Onboard Peripheral Drivers"
9696
bool "Enable CAMERA (ov5640)"
9797
select BSP_USING_MFX
9898
select BSP_USING_PMIC
99+
select BSP_USING_SDMMC
100+
select BSP_USING_SDCARD
99101
select BSP_USING_I2C
100102
select BSP_USING_I2C2
101103
default n

bsp/stm32/stm32mp157a-st-ev1/board/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if GetDepend(['BSP_USING_NAND']):
2525
if GetDepend(['BSP_USING_GBE']):
2626
src += Glob('ports/eth/drv_eth.c')
2727

28-
if GetDepend(['BSP_USING_SD_CARD']):
28+
if GetDepend(['BSP_USING_SDCARD']):
2929
src += Glob('ports/drv_sdcard.c')
3030

3131
if GetDepend(['BSP_USING_EMMC']):

bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dfsdm.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,34 @@
1818
#define LOG_TAG "drv.dfsdm"
1919
#include <drv_log.h>
2020

21-
#define FILTER_FIFO_SIZE (1024)
21+
#define FILTER_FIFO_SIZE (1024)
2222
#if defined(__CC_ARM) || defined(__CLANG_ARM)
23-
__attribute__((at(0x2FFC8000)))
23+
__attribute__((at(0x2FFC8000))) static rt_int32_t FILTER0_FIFO[FILTER_FIFO_SIZE];
2424
#elif defined ( __GNUC__ )
25-
__attribute__((at(0x2FFC8000)))
25+
static rt_int32_t FILTER0_FIFO[FILTER_FIFO_SIZE] __attribute__((section(".Filter0Section")));
2626
#elif defined(__ICCARM__)
2727
#pragma location = 0x2FFC8000
28+
__no_init static rt_int32_t FILTER0_FIFO[FILTER_FIFO_SIZE];
2829
#endif
29-
rt_int32_t FILTER0_FIFO[FILTER_FIFO_SIZE];
3030

31-
#define PALY_SIZE 2048
3231
#if defined(__CC_ARM) || defined(__CLANG_ARM)
33-
__attribute__((at(0x2FFCA000)))
32+
__attribute__((at(0x2FFC9000))) static rt_int32_t FILTER0_FIFO[FILTER_FIFO_SIZE];
3433
#elif defined ( __GNUC__ )
35-
__attribute__((at(0x2FFCA000)))
34+
static rt_int32_t FILTER0_FIFO[FILTER_FIFO_SIZE] __attribute__((section(".Filter1Section")));
3635
#elif defined(__ICCARM__)
37-
#pragma location = 0x2FFCA000
36+
#pragma location = 0x2FFC9000
37+
__no_init static rt_int32_t FILTER1_FIFO[FILTER_FIFO_SIZE];
3838
#endif
39-
static rt_int16_t PLAY_BUF[PALY_SIZE];
40-
39+
40+
#define PALY_SIZE 2048
4141
#if defined(__CC_ARM) || defined(__CLANG_ARM)
42-
__attribute__((at(0x2FFC9000)))
42+
__attribute__((at(0x2FFCA000))) static rt_int16_t PLAY_BUF[PALY_SIZE];
4343
#elif defined ( __GNUC__ )
44-
__attribute__((at(0x2FFC9000)))
44+
__attribute__((at(0x2FFCA000))) __attribute__((section(".DfsdmSection")));
4545
#elif defined(__ICCARM__)
46-
#pragma location = 0x2FFC9000
46+
#pragma location = 0x2FFCA000
47+
__no_init static rt_int16_t PLAY_BUF[PALY_SIZE];
4748
#endif
48-
rt_int32_t FILTER1_FIFO[FILTER_FIFO_SIZE];
4949

5050
static volatile rt_uint8_t DmaLeftRecBuffCplt = 0;
5151
static volatile rt_uint8_t DmaRightRecBuffCplt = 0;

bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_emmc.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ struct rthw_sdio
4949
};
5050

5151
#define EMMC_BUFF_SIZE 4096
52+
#define EMMC_BUFF_ADDR 0x2FFCB000
5253
#if defined(__CC_ARM) || defined(__CLANG_ARM)
53-
rt_uint8_t cache_buf[SDIO_BUFF_SIZE] __attribute__((at(0x2FFCB000)));
54-
#elif defined(__ICCARM__)
55-
#pragma location = 0x2FFCB000
56-
rt_uint8_t cache_buf[EMMC_BUFF_SIZE];
54+
__attribute__((at(EMMC_BUFF_ADDR))) static rt_uint8_t cache_buf[EMMC_BUFF_SIZE];
5755
#elif defined ( __GNUC__ )
58-
rt_uint8_t cache_buf[SDIO_BUFF_SIZE] __attribute__((at(0x2FFCB000)));
56+
static rt_uint8_t cache_buf[EMMC_BUFF_SIZE] __attribute__((section(".eMMCSection")));
57+
#elif defined(__ICCARM__)
58+
#pragma location = EMMC_BUFF_ADDR
59+
__no_init static rt_uint8_t cache_buf[EMMC_BUFF_SIZE];
5960
#endif
6061

6162
#if defined(EMMC_RX_DUMP) || defined(EMMC_TX_DUMP)
@@ -558,7 +559,7 @@ int rt_hw_sdio_init(void)
558559
}
559560
INIT_DEVICE_EXPORT(rt_hw_sdio_init);
560561

561-
#if defined(EMMC_USING_DFS)
562+
#if defined(BSP_USING_EMMC_FS)
562563
int mnt_init(void)
563564
{
564565
rt_device_t sd = RT_NULL;

bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_ov5640.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,22 @@
2828
#define JPEG_LINE_SIZE 1 * 1024
2929

3030
#if defined(__CC_ARM) || defined(__CLANG_ARM)
31-
__attribute__((at(0x2FFCC000)))
31+
__attribute__((at(0x2FFCC000))) static rt_int32_t JPEG_DATA_BUF[JPEG_BUF_SIZE];
3232
#elif defined(__GNUC__)
33-
__attribute__((at(0x2FFCC000)))
33+
static rt_int32_t JPEG_DATA_BUF[JPEG_BUF_SIZE] __attribute__((section(".Dcmi0Section")));
3434
#elif defined(__ICCARM__)
3535
#pragma location = 0x2FFCC000
36+
__no_init static rt_int32_t JPEG_DATA_BUF[JPEG_BUF_SIZE];
3637
#endif
37-
static rt_int32_t JPEG_DATA_BUF[JPEG_BUF_SIZE];
3838

3939
#if defined(__CC_ARM) || defined(__CLANG_ARM)
40-
__attribute__((at(0x2FFDC000)))
40+
__attribute__((at(0x2FFDC000))) static rt_int32_t JPEG_LINE_BUF[2][JPEG_LINE_SIZE];
4141
#elif defined(__GNUC__)
42-
__attribute__((at(0x2FFDC000)))
42+
static rt_int32_t JPEG_LINE_BUF[2][JPEG_LINE_SIZE] __attribute__((section(".Dcmi1Section")));
4343
#elif defined(__ICCARM__)
4444
#pragma location = 0x2FFDC000
45+
__no_init static rt_int32_t JPEG_LINE_BUF[2][JPEG_LINE_SIZE];
4546
#endif
46-
static rt_int32_t JPEG_LINE_BUF[2][JPEG_LINE_SIZE];
47-
4847

4948
volatile rt_uint32_t jpeg_data_len = 0;
5049
volatile rt_uint8_t jpeg_data_ok = 0;

bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sdcard.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include "board.h"
1212

13-
#if defined(BSP_USING_SD_CARD)
13+
#if defined(BSP_USING_SDCARD)
1414
#include <dfs_fs.h>
1515

1616
#define DRV_DEBUG
@@ -41,14 +41,15 @@ struct rt_completion rx_comp;
4141

4242
/* SYSRAM SDMMC1/2 accesses */
4343
#define SDIO_BUFF_SIZE 512
44+
#define SDCARD_ADDR 0x2FFC0000
4445
#if defined(__CC_ARM) || defined(__CLANG_ARM)
45-
__attribute__((at(0x2FFC0000)))
46+
__attribute__((at(SDCARD_ADDR))) static rt_uint32_t cache_buf[SDIO_BUFF_SIZE];
4647
#elif defined ( __GNUC__ )
47-
__attribute__((at(0x2FFC0000)))
48+
static rt_uint32_t cache_buf[SDIO_BUFF_SIZE] __attribute__((section(".SdCardSection")));
4849
#elif defined(__ICCARM__)
49-
#pragma location = 0x2FFC0000
50+
#pragma location = SDCARD_ADDR
51+
__no_init static rt_uint32_t cache_buf[SDIO_BUFF_SIZE];
5052
#endif
51-
static rt_uint32_t cache_buf[SDIO_BUFF_SIZE];
5253

5354
#if defined(SDMMC_RX_DUMP) || defined(SDMMC_TX_DUMP)
5455
#define __is_print(ch) ((unsigned int)((ch) - ' ') < 127u - ' ')
@@ -378,7 +379,7 @@ int rt_hw_sdcard_init(void)
378379
}
379380
INIT_DEVICE_EXPORT(rt_hw_sdcard_init);
380381

381-
#if defined(SD_USING_DFS)
382+
#if defined(BSP_USING_SDCARD_FS)
382383
int mnt_init(void)
383384
{
384385
rt_device_t sd_dev = RT_NULL;

bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sound.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323

2424
#define TX_FIFO_SIZE (4096)
2525
#if defined(__CC_ARM) || defined(__CLANG_ARM)
26-
__attribute__((at(0x2FFC2000)))
26+
__attribute__((at(0x2FFC2000))) static rt_uint8_t AUDIO_TX_FIFO[TX_FIFO_SIZE];
2727
#elif defined ( __GNUC__ )
28-
__attribute__((at(0x2FFC2000)))
28+
static rt_uint8_t AUDIO_TX_FIFO[TX_FIFO_SIZE] __attribute__((section(".AudioSection")));
2929
#elif defined(__ICCARM__)
3030
#pragma location = 0x2FFC2000
31+
__no_init static rt_uint8_t AUDIO_TX_FIFO[TX_FIFO_SIZE];
3132
#endif
32-
static rt_uint8_t AUDIO_TX_FIFO[TX_FIFO_SIZE];
3333

3434
struct sound_device
3535
{
@@ -348,7 +348,7 @@ static rt_err_t sound_start(struct rt_audio_device *audio, int stream)
348348

349349
RT_ASSERT(audio != RT_NULL);
350350
snd_dev = (struct sound_device *)audio->parent.user_data;
351-
351+
352352
if (stream == AUDIO_STREAM_REPLAY)
353353
{
354354
LOG_D("open sound device");
@@ -367,15 +367,11 @@ static rt_err_t sound_start(struct rt_audio_device *audio, int stream)
367367

368368
static rt_err_t sound_stop(struct rt_audio_device *audio, int stream)
369369
{
370-
struct sound_device *device;
371370
RT_ASSERT(audio != RT_NULL);
372-
device = (struct sound_device *)audio->parent.user_data;
373371

374372
if (stream == AUDIO_STREAM_REPLAY)
375373
{
376374
HAL_SAI_DMAStop(&hsai_BlockA2);
377-
378-
rt_device_close(device->decoder);
379375

380376
LOG_D("close sound device");
381377
}

bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,36 @@ rt_base_t level;
3333
#if defined(__ICCARM__)
3434
/* transmit buffer */
3535
#pragma location = TX_ADD_BASE
36-
static uint8_t txBuffer[ETH_TXBUFNB][ETH_TX_BUF_SIZE];
36+
__no_init static rt_uint8_t txBuffer[ETH_TXBUFNB][ETH_TX_BUF_SIZE];
3737
/* Receive buffer */
3838
#pragma location = RX_ADD_BASE
39-
static uint8_t rxBuffer[ETH_RXBUFNB][ETH_RX_BUF_SIZE];
39+
__no_init static rt_uint8_t rxBuffer[ETH_RXBUFNB][ETH_RX_BUF_SIZE];
4040
/* Transmit DMA descriptors */
4141
#pragma location = TX_DMA_ADD_BASE
42-
static TxDmaDesc txDmaDesc[ETH_TXBUFNB];
42+
__no_init static TxDmaDesc txDmaDesc[ETH_TXBUFNB];
4343
/* Receive DMA descriptors */
4444
#pragma location = RX_DMA_ADD_BASE
45-
static RxDmaDesc rxDmaDesc[ETH_RXBUFNB];
45+
__no_init static RxDmaDesc rxDmaDesc[ETH_RXBUFNB];
4646

4747
#elif defined(__CC_ARM) || defined(__CLANG_ARM)
4848
/* transmit buffer */
49-
static uint8_t txBuffer[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((at(TX_ADD_BASE)));
49+
static rt_uint8_t txBuffer[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((at(TX_ADD_BASE)));
5050
/* Receive buffer */
51-
static uint8_t rxBuffer[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((at(RX_ADD_BASE)));
51+
static rt_uint8_t rxBuffer[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((at(RX_ADD_BASE)));
5252
/* Transmit DMA descriptors */
5353
static TxDmaDesc txDmaDesc[ETH_TXBUFNB] __attribute__((at(TX_DMA_ADD_BASE)));
5454
/* Receive DMA descriptors */
5555
static RxDmaDesc rxDmaDesc[ETH_RXBUFNB] __attribute__((at(RX_DMA_ADD_BASE)));
5656

5757
#elif defined ( __GNUC__ )
5858
/* transmit buffer */
59-
static uint8_t txBuffer[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((at(TX_ADD_BASE)));
59+
static rt_uint8_t txBuffer[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((section(".TxArraySection")));
6060
/* Receive buffer */
61-
static uint8_t rxBuffer[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((at(RX_ADD_BASE)));
61+
static rt_uint8_t rxBuffer[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((section(".RxArraySection")));
6262
/* Transmit DMA descriptors */
63-
static TxDmaDesc txDmaDesc[ETH_TXBUFNB] __attribute__((at(TX_DMA_ADD_BASE)));
63+
static TxDmaDesc txDmaDesc[ETH_TXBUFNB] __attribute__((section(".TxDecripSection")));
6464
/* Receive DMA descriptors */
65-
static RxDmaDesc rxDmaDesc[ETH_RXBUFNB] __attribute__((at(RX_DMA_ADD_BASE)));
65+
static RxDmaDesc rxDmaDesc[ETH_RXBUFNB] __attribute__((section(".RxDecripSection")));
6666
#endif
6767

6868
//Current transmit descriptor

0 commit comments

Comments
 (0)