• Deeric
    了解作者
  • C/C++
    开发工具
  • 133KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 61
    下载次数
  • 2018-09-17 21:27
    上传日期
瑞萨RL78系列 BootLoader例程
RL78G13_Bootloader.rar
  • RL78G13_Bootloader
  • inc
  • r_typedefs.h
    3.2KB
  • Flash
  • src
  • r_flash_main.c
    3.6KB
  • DefaultBuild
  • Flash.map
    19.8KB
  • Flash.hxb
    9.9KB
  • Flash.vfi
    1KB
  • Flash.hxf
    797B
  • Flash.sym
    24.6KB
  • r_flash_main.rel
    2.4KB
  • Flash.lmf
    59.7KB
  • Flash.akhil.mtud
    6.4KB
  • Flash.mtsp
    159KB
  • DefaultBuild
  • Boot
  • src
  • fsl.h
    44.6KB
  • r_optionbyte.asm
    2.3KB
  • r_boot_main.c
    7.9KB
  • r_timer.h
    2.9KB
  • r_timer.c
    6KB
  • fsl_linker_file.dr
    2.4KB
  • r_xmodem.h
    2.9KB
  • r_xmodem.c
    10.6KB
  • fsl_types.h
    8.5KB
  • r_serial.c
    5.5KB
  • r_serial.h
    2.9KB
  • DefaultBuild
  • Boot.sym
    24.3KB
  • r_optionbyte.rel
    372B
  • Boot.hex
    182.4KB
  • Boot.vfi
    1.2KB
  • r_xmodem.rel
    7.6KB
  • r_boot_main.rel
    9.7KB
  • r_timer.rel
    3.1KB
  • r_serial.rel
    3KB
  • r_optionbyte.prn
    4.7KB
  • lib
  • fsl.lib
    15.5KB
  • Boot.mtsp
    169.4KB
  • Boot.akhil.mtud
    6.4KB
  • RL78G13_Bootloader.mtpj
    157.7KB
  • RL78G13_Bootloader.akhil.mtud
    102.4KB
内容介绍
/******************************************************************************** * DISCLAIMER * This software is supplied by Renesas Electronics Corporation and is only * intended for use with Renesas products. No other uses are authorized. This * software is owned by Renesas Electronics Corporation and is protected under * all applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this software * and to discontinue the availability of this software. By using this software, * you agree to the additional terms and conditions found by accessing the * following link: * http://www.renesas.com/disclaimer * * Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved. ********************************************************************************/ /******************************************************************************** * File Name : r_xmodem.c * Version : 1.00 * Description : This file implements the XMODEM communication protocol. ********************************************************************************/ /******************************************************************************** * History : DD.MM.YYYY Version Description * : 30.12.2012 1.00 First Release ********************************************************************************/ /******************************************************************************** Includes <System Includes> , "Project Includes" ********************************************************************************/ #include "r_typedefs.h" #include "r_timer.h" #include "r_serial.h" #include "fsl.h" #include "fsl_types.h" /******************************************************************************** Macro definitions ********************************************************************************/ /******************************************************************************** Typedef definitions ********************************************************************************/ /******************************************************************************** Exported global variables ********************************************************************************/ /******************************************************************************** Exported global functions ********************************************************************************/ /******************************************************************************** * Function Name : WriteFlash * Description : This function initializes the TAU0 Channel 0 module. * Parameters : addr - * start address to write * data[] - * data buffer to write * len - * size of data buffer * Return value : fsl_u08, status_code * = 0x00(FSL_OK), normal * = 0x05(FSL_ERR_PARAMETER), parameter error * = 0x10(FSL_ERR_PROTECTION), protection error * = 0x1C(FSL_ERR_WRITE), write error * = 0x1F(FSL_ERR_FLOW), last operation has not finished, yet. * or violates the precondition. * or FSL is suspending. * = 0xFF(FSL_BUSY), normal and means "process was started" ********************************************************************************/ fsl_u08 WriteFlash(uint16_t addr, int8_t data[], uint8_t size) { __near fsl_write_t my_fsl_write_str; my_fsl_write_str.fsl_data_buffer_p_u08 = (__near fsl_u08 *) data; my_fsl_write_str.fsl_word_count_u08 = size/4; my_fsl_write_str.fsl_destination_address_u32 = addr; return FSL_Write((__near fsl_write_t*) &my_fsl_write_str); } /******************************************************************************** * Function Name : GetByte * Description : This function recieves a byte of UART0 data. * Parameters : timeout - * time limit for reception * data - * data buffer pointer * Return value : uint8_t, status * TRUE or FALSE ********************************************************************************/ uint8_t GetByte (uint32_t timeout, int8_t *data) { uint32_t tick_count; tick_count = timeout; TAU0_Channel0_Start(); /* wait for a byte to arrive */ while ((SRIF0 == 0) && (tick_count)) { WDTE = 0xac; if (TMIF00 == 1) { TMIF00 = 0; TAU0_Channel0_Stop(); if (--tick_count) { TAU0_Channel0_Start(); } } } if (tick_count == 0) { *data = '0'; return FALSE; } *data=(uint8_t) RXD0; SRIF0 = 0; return TRUE; } /******************************************************************************** * Function Name : XmodemProg * Description : This function uses the XModem protocol to recieve data and write data into rom memory. * Parameters : flash_start_address - * the start address of rom memory to write * Return value : uint8_t, status XM_OK, XM_TIMEOUT, XM_ADDRESS_ERROR or XM_PROG_FAIL ********************************************************************************/ uint8_t XmodemProg(uint16_t flash_start_address) { uint16_t ret; uint8_t expected_blk_num; uint8_t retry_counter; uint32_t rx_byte_count; uint8_t rx_byte_buffer_index; uint8_t status; uint8_t checksum; uint8_t start_condition; uint16_t Address; uint8_t count; uint8_t tmp; uint16_t ROM_checksum; uint16_t UART_checksum; uint8_t CHK[4] = {0}; uint8_t rx_buffer[XMODEM_BUFFER_SIZE]; __far int8_t* ptr; /* first xmodem block number is 1 */ expected_blk_num = 1; start_condition = TRUE; UART_checksum = 0; ROM_checksum = 0; Address = flash_start_address; while (1) { /* initialise Rx attempts */ retry_counter = 10; ret = FALSE; /* decrement Rx attempts counter & get Rx data byte with a 10 sec timeout contdition, and repeat until Rx attempts is 0 */ while ((retry_counter > 0) && (ret == FALSE)) { /* if this is the start of the xmodem frame */ if (start_condition == TRUE) { /* send a NAK to the transmitter */ UART0_Send_Byte(NAK); /* Kick off the XModem transfer */ ret = GetByte(10000, (int8_t*)&rx_buffer[0]); } else { /* wait for all data to be received */ /* or EOT */ ret = GetByte(10000, (int8_t*)&rx_buffer[0]); } retry_counter--; } start_condition = FALSE; if (ret == FALSE) { return (XM_TIMEOUT); } else { /* if first received byte is "end of frame" */ /* return ACK to sender */ if (rx_buffer[0] == EOT) { UART0_Send_Byte(ACK); for (ptr=(__far int8_t*)flash_start_address; ptr<(__far int8_t*)Address; ptr++) { tmp = *ptr; ROM_checksum += tmp; } if (ROM_checksum == UART_checksum) { CHK[0] = (uint8_t)(ROM_checksum & 0x00FF); CHK[1] = (uint8_t)((ROM_checksum & 0xFF00)>>8); CHK[2] = (uint8_t)(Address & 0x
评论
    相关推荐
    • Proteus7.12.rar
      Proteus7.12完美破解版.rar电路仿真软件很好用可以仿真单片数字模拟电路
    • VHDL 的实例程序,共44个.rar
      经典VHDL 的实例程序,共44个!要下载的尽快
    • USBtoRS232Driver.rar
      USB转串口驱动程序,可以用在笔记本电脑上,方便的通过串口给单片机下载程序!
    • 模糊控制程序.rar
      模糊PID控制程序的源码,是作业,有讲解,
    • 串口编程源代码.rar
      这是本人最近几年所编写的串行通讯的代码集,可以供大家参考学习。
    • DELTA_PLC.rar
      台达PLC Modbus协议通信dll com控件
    • hongwaigooog.rar
      单片机红外遥控最全的资料,包含很多当前电视遥控专用芯片的解码方式,C语言和汇编语言编写的解码范例程序,看完了你就会了!
    • MF500绝密.rar
      非接触式IC卡开发板源程序,包括原理图/PCB图;源程序在KEIL环境下编译,打开压缩包后直接点击PRJ文件,即可编译使用。 这是个保密文件,做Mifare one卡开发人基本上都用过到这个源代码。
    • 20078251299410.rar
      C51实用程序(45个) I/O、定时器、中断、看门狗、计数器、软件AD、VB串口、93c06驱动、24c02系列驱动、7219、20045、软件陷阱、串口中断、码值转换、AVR通讯、IIC、DS1302、DS1820、SPI、1602、12232、12864、T6963、1330、PC键、键盘输入法、智能化、飞机游戏、贪吃蛇、多级菜单实例等
    • mcudesign.rar
      单片机设计,毕业设计 16×16点阵(滚动显示)论文+程序 cdma通信系统中的接入信道部分进行仿真与分析 LED显示屏动态显示和远程监控的实现 MCS-51单片机温度控制系统 USB接口设计 毕业设计(论文)OFDM通信系统基带数据 仓库温湿度的监测系统 单片机串行通信发射机 单片机课程设计__电子密码锁报告 单片机控制交通灯 电动智能小车(完整论文 电气工程系06届毕业设计开题报告 电信运营商收入保障系统设计与实现 电子设计大赛点阵电子显示屏(A题 电子时钟 火灾自动报警系统设计 基于GSM短信模块的家庭防盗报警系统 基于GSM模块的车载防盗系统设计 TC35i 资料 基于网络的虚拟仪器测试系统 门控自动照明电路 全遥控数字音量控制的D类功率放大器 数控直流稳压电源完整论文 数字密码锁设计 数字抢答器(数字电路) 数字时钟 水箱单片机控制系统 同步电机模型的MATLAB仿真 温度监控系统的设计 用单片机控制直流电机 用单片机实现温度远程显示 智能家用电热水器控制器 智能型充电器电源和显示的设计 自动加料机控制系统