IN_RAM(FLASH_Status_TypeDef FLASH_WaitForLastOperation(FLASH_MemType_TypeDef FLASH_MemType))
IN_RAM(void FLASH_EraseBlock(uint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType))
IN_RAM(void FLASH_ProgramBlock(uint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType,
FLASH_ProgramMode_TypeDef FLASH_ProgMode, uint8_t *Buffer))
stm8s_flash.c这三个函数下的assert_param都报警告。有遇到同样情况的吗?
我看过帖子说是吧assert_param也加上IN_RAM,但警告依旧。- IN_RAM(void FLASH_ProgramBlock(uint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType,
- FLASH_ProgramMode_TypeDef FLASH_ProgMode, uint8_t *Buffer))
- {
- uint16_t Count = 0;
- uint32_t startaddress = 0;
- /* Check parameters */
- assert_param(IS_MEMORY_TYPE_OK(FLASH_MemType));
- assert_param(IS_FLASH_PROGRAM_MODE_OK(FLASH_ProgMode));
- if (FLASH_MemType == FLASH_MEMTYPE_PROG)
- {
- assert_param(IS_FLASH_PROG_BLOCK_NUMBER_OK(BlockNum));
- startaddress = FLASH_PROG_START_PHYSICAL_ADDRESS;
- }
- else
- {
- assert_param(IS_FLASH_DATA_BLOCK_NUMBER_OK(BlockNum));
- startaddress = FLASH_DATA_START_PHYSICAL_ADDRESS;
- }
- /* Point to the first block address */
- startaddress = startaddress + ((uint32_t)BlockNum * FLASH_BLOCK_SIZE);
- /* Selection of Standard or Fast programming mode */
- if (FLASH_ProgMode == FLASH_PROGRAMMODE_STANDARD)
- {
- /* Standard programming mode */ /*No need in standard mode */
- FLASH->CR2 |= FLASH_CR2_PRG;
- FLASH->NCR2 &= (uint8_t)(~FLASH_NCR2_NPRG);
- }
- else
- {
- /* Fast programming mode */
- FLASH->CR2 |= FLASH_CR2_FPRG;
- FLASH->NCR2 &= (uint8_t)(~FLASH_NCR2_NFPRG);
- }
- /* Copy data bytes from RAM to FLASH memory */
- for (Count = 0; Count < FLASH_BLOCK_SIZE; Count++)
- {
- #if defined (STM8S208) || defined(STM8S207) || defined(STM8S007) || defined(STM8S105) || \
- defined(STM8S005) || defined (STM8AF62Ax) || defined (STM8AF52Ax) || defined (STM8AF626x)
- *((PointerAttr uint8_t*) (uint16_t)startaddress + Count) = ((uint8_t)(Buffer[Count]));
- #elif defined(STM8S103) || defined(STM8S003) || defined (STM8S903)
- *((PointerAttr uint8_t*) (uint16_t)startaddress + Count) = ((uint8_t)(Buffer[Count]));
- #endif
- }
- }
Warning[Ta007]: Call to a non __ramfunc function (assert_failed) from within a __ramfunc function
|