×

STM32之SRAM调试资料下载

消耗积分:3 | 格式:pdf | 大小:337.78KB | 2021-04-18

分享资料个

在学习STM32的时候,由于烧FLASH的所造成的时间会比较慢,而在SRAM中调试的时间会比FLASH快很多,再加上FLASH的时候会经常擦除芯片,会对芯片的寿命造成一定的影响,其实我本人觉得在学习STM32的路途中,没有必要也大可不必使用烧FLASH的路径来对芯片进行实验性的学习,但是在SRAM中调试所造成的影响就是断电的时候数据会丢失。个人以STM32ZET6为例子,因为我的板子的芯片是ZET6的,不过设置除了地址空间不一样之外、其他都基本雷同。首先,STM32的启动模式有三种,在STM32F10xxx里,可以通过BOOT[1:0]引脚选择三种不同启动模式。从这张表格可以看出来,当启动模式为SRAM时,BOOT[1:0]=1:1;请注意:从内置SRAM启动:只能在0x2000 0000开始的地址区访问SRAM。请记住这个0x2000 0000,因为待会我们要用到。以上不失为一种方法,接下来我要从另外一个角度来设置SRAM:打开keil4,点击图标,大家可以看到Target里的界面,请大家注意红色区域,这里是从0x2000 0000开始的,看到这大家明白我为什么要让大家记住0x2000 0000吧,由于我的ZET6是64K,也就是0x100000,在这里我把它分区了,也就是从0x2000 0000到0xB000 0x2000 B000到0x5000;(大家注意:B和5的数值可以任意,但是其和不能超过F,这决定了你所分区的大小);点击C/C++ 添加VECT_TAB_RAM 如图接下来,添加脚本文件,此脚本文件的作用是什么,目前我还不清楚,但是我觉得应该是改变其中断向量什么的吧,点击Debug,请看红色区域部分,点击Edit添加,其代码如下:/******************************************************************************//* RAM.INI: RAM Initialization File *//******************************************************************************/// <<< Use Configuration Wizard in Context Menu >>> ///******************************************************************************//* This file is part of the uVision/ARM development tools. *//* Copyright (c) 2005-2007 Keil Software. All rights reserved. *//* This software may only be used under the terms of a valid, current, *//* end user licence from KEIL for a compatible version of KEIL software *//* development tools. Nothing else gives you the right to use this software. *//******************************************************************************/FUNC void Setup (void) {SP = _RDWORD(0x20000000); // Setup Stack PointerPC = _RDWORD(0x20000004); // Setup Program Counter_WDWORD(0xE000ED08, 0x20000000); // Setup Vector Table}//LOAD ARM\Blinky.axf INCREMENTAL // DownloadSetup(); // Setup for Runningg, main此代码也可以在百度上查找,其路径在你指定的main.c里的同个文件夹,以我的为例(正点原子的历程模版)点击Setting 如图 红色区域要打钩好了,接下来点击Utilities,可以看到红色区域内的是要打钩的点击Setting可以看到Flash Download请看图:有三处红色区域要进行更改这里的空间地址跟最初设置的一样,不要搞错了,否则会有预想不到的错误,就像小怪兽一样破坏你前进的道路,不过有奥特曼,你别怕哈,、、好了,到这里,大家就可以享受什么是快了、、、(mbbeetchina)

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !

'+ '

'+ '

'+ ''+ '
'+ ''+ ''+ '
'+ ''+ '' ); $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code ==5){ $(pop_this).attr('href',"/login/index.html"); return false } if(data.code == 2){ //跳转到VIP升级页面 window.location.href="//m.obk20.com/vip/index?aid=" + webid return false } //是会员 if (data.code > 0) { $('body').append(htmlSetNormalDownload); var getWidth=$("#poplayer").width(); $("#poplayer").css("margin-left","-"+getWidth/2+"px"); $('#tips').html(data.msg) $('.download_confirm').click(function(){ $('#dialog').remove(); }) } else { var down_url = $('#vipdownload').attr('data-url'); isBindAnalysisForm(pop_this, down_url, 1) } }); }); //是否开通VIP $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code == 2 || data.code ==5){ //跳转到VIP升级页面 $('#vipdownload>span').text("开通VIP 免费下载") return false }else{ // 待续费 if(data.code == 3) { vipExpiredInfo.ifVipExpired = true vipExpiredInfo.vipExpiredDate = data.data.endoftime } $('#vipdownload .icon-vip-tips').remove() $('#vipdownload>span').text("VIP免积分下载") } }); }).on("click",".download_cancel",function(){ $('#dialog').remove(); }) var setWeixinShare={};//定义默认的微信分享信息,页面如果要自定义分享,直接更改此变量即可 if(window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger'){ var d={ title:'STM32之SRAM调试资料下载',//标题 desc:$('[name=description]').attr("content"), //描述 imgUrl:'https://'+location.host+'/static/images/ele-logo.png',// 分享图标,默认是logo link:'',//链接 type:'',// 分享类型,music、video或link,不填默认为link dataUrl:'',//如果type是music或video,则要提供数据链接,默认为空 success:'', // 用户确认分享后执行的回调函数 cancel:''// 用户取消分享后执行的回调函数 } setWeixinShare=$.extend(d,setWeixinShare); $.ajax({ url:"//www.obk20.com/app/wechat/index.php?s=Home/ShareConfig/index", data:"share_url="+encodeURIComponent(location.href)+"&format=jsonp&domain=m", type:'get', dataType:'jsonp', success:function(res){ if(res.status!="successed"){ return false; } $.getScript('https://res.wx.qq.com/open/js/jweixin-1.0.0.js',function(result,status){ if(status!="success"){ return false; } var getWxCfg=res.data; wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId:getWxCfg.appId, // 必填,公众号的唯一标识 timestamp:getWxCfg.timestamp, // 必填,生成签名的时间戳 nonceStr:getWxCfg.nonceStr, // 必填,生成签名的随机串 signature:getWxCfg.signature,// 必填,签名,见附录1 jsApiList:['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 wx.onMenuShareTimeline({ title: setWeixinShare.title, // 分享标题 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享给朋友”按钮点击状态及自定义分享内容接口 wx.onMenuShareAppMessage({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 type: setWeixinShare.type, // 分享类型,music、video或link,不填默认为link dataUrl: setWeixinShare.dataUrl, // 如果type是music或video,则要提供数据链接,默认为空 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ”按钮点击状态及自定义分享内容接口 wx.onMenuShareQQ({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 wx.onMenuShareWeibo({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 wx.onMenuShareQZone({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); }); }); } }); } function openX_ad(posterid, htmlid, width, height) { if ($(htmlid).length > 0) { var randomnumber = Math.random(); var now_url = encodeURIComponent(window.location.href); var ga = document.createElement('iframe'); ga.src = 'https://www1.elecfans.com/www/delivery/myafr.php?target=_blank&cb=' + randomnumber + '&zoneid=' + posterid+'&prefer='+now_url; ga.width = width; ga.height = height; ga.frameBorder = 0; ga.scrolling = 'no'; var s = $(htmlid).append(ga); } } openX_ad(828, '#berry-300', 300, 250);